[Rt-commit] rt branch, 4.4/prompt-for-password-fulltext-index, created. rt-4.4.2-133-gb4e264de2
Maureen Mirville
maureen at bestpractical.com
Mon Apr 9 16:16:46 EDT 2018
The branch, 4.4/prompt-for-password-fulltext-index has been created
at b4e264de215f84dddde77f05273347220a2db031 (commit)
- Log -----------------------------------------------------------------
commit b4e264de215f84dddde77f05273347220a2db031
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date: Mon Apr 9 16:15:29 2018 -0400
Allow rt-setup-fulltext-index to prompt for dba password
diff --git a/sbin/rt-setup-fulltext-index.in b/sbin/rt-setup-fulltext-index.in
index 03863fbfa..cc7be6058 100644
--- a/sbin/rt-setup-fulltext-index.in
+++ b/sbin/rt-setup-fulltext-index.in
@@ -49,6 +49,7 @@
use strict;
use warnings;
no warnings 'once';
+use Term::ReadKey;
# fix lib paths, some may be relative
BEGIN { # BEGIN RT CMD BOILERPLATE
@@ -650,6 +651,16 @@ sub dba_handle {
$ENV{'NLS_NCHAR'} = "AL32UTF8";
}
my $dsn = do { my $h = new RT::Handle; $h->BuildDSN; $h->DSN };
+ my $password;
+ if ( $DB{'admin_password'} || $ENV{'RT_DBA_PASSWORD'} ) {
+ $password = $DB{'admin_password'} || $ENV{'RT_DBA_PASSWORD'};
+ } else {
+ print "Please enter $DB{'type'} admin password: ";
+ ReadMode('noecho');
+ $password = ReadLine(0);
+ ReadMode('normal');
+ }
+ $DB{'admin_password'} = $password;
my $dbh = DBI->connect(
$dsn, $DB{admin}, $DB{admin_password},
{ RaiseError => 1, PrintError => 1 },
-----------------------------------------------------------------------
More information about the rt-commit
mailing list