Description of problem: Found when running db2index.pl and using the -w - option to provide the password. Both the system perl and the version of perl shipped with Directory i.e. nsperl are missing Term::ReadKey needed for this option Version-Release number of selected component (if applicable): 7.1 SP1 How reproducible: Always Steps to Reproduce: 1. nsperl db2index.pl -v -D "cn=Directory Manager" -w - -n example Actual results: The following message is displayed: The '-w -' option requires an extension library (Term::ReadKey) which is not part of the standard perl distribution. If you want to use it, you must download and install the module. You can find it at http://www.perl.com/CPAN/CPAN.html Expected results: I should be prompted to type in the password according to the usage message Additional info:
The newer version of perl on all platform may be this already.
That's a result of code in, apparently, a numbed of the utils ... e.g., in "ldif2db.pl" as well. There's a hardcoded 'die' in the script, used if passwd == "-" (which is the prompt flag), that needs to be removed, and some lines that need to be uncommented. It's an easy patch, e.g.: --- /usr/lib64/dirsrv/slapd-auth/ldif2db.pl.ORIG 2008-09-11 07:56:50.000000000 -0700 +++ /usr/lib64/dirsrv/slapd-auth/ldif2db.pl 2008-09-11 07:57:47.000000000 -0700 @@ -167,17 +167,17 @@ close(RPASS); } elsif ($passwd eq "-"){ # Read the password from terminal - die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", +# die "The '-w -' option requires an extension library (Term::ReadKey) which is not\n", "part of the standard perl distribution. If you want to use it, you must\n", "download and install the module. You can find it at\n", "http://www.perl.com/CPAN/CPAN.html\n"; # Remove the previous line and uncomment the following 6 lines once you have installed Term::ReadKey module. -# use Term::ReadKey; -# print "Bind Password: "; -# ReadMode('noecho'); -# $passwd = ReadLine(0); -# chomp($passwd); -# ReadMode('normal'); + use Term::ReadKey; + print "Bind Password: "; + ReadMode('noecho'); + $passwd = ReadLine(0); + chomp($passwd); + ReadMode('normal'); } if (($instance eq "" && $included[0] eq "") || $ldiffiles[0] eq "" || $rootdn eq "" || $passwd eq "") { &usage; exit(1); } ($s, $m, $h, $dy, $mn, $yr, $wdy, $ydy, $r) = localtime(time);
Created attachment 328607 [details] CVS Diffs This patch removes the dependency on Term::ReadKey for password prompting in our Perl scripts and instead uses the same method that we use in the setup code for non-echoed password prompts.
Checked into ldapserver (HEAD). Thanks to Rich for his review! Checking in ldap/admin/src/scripts/template-bak2db.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-bak2db.pl.in,v <-- template-bak2db.pl.in new revision: 1.5; previous revision: 1.4 done Checking in ldap/admin/src/scripts/template-db2bak.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-db2bak.pl.in,v <-- template-db2bak.pl.in new revision: 1.8; previous revision: 1.7 done Checking in ldap/admin/src/scripts/template-db2index.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-db2index.pl.in,v <-- template-db2index.pl.in new revision: 1.6; previous revision: 1.5 done Checking in ldap/admin/src/scripts/template-db2ldif.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-db2ldif.pl.in,v <-- template-db2ldif.pl.in new revision: 1.7; previous revision: 1.6 done Checking in ldap/admin/src/scripts/template-fixup-memberof.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-fixup-memberof.pl.in,v <-- template-fixup-memberof.pl.in new revision: 1.2; previous revision: 1.1 done Checking in ldap/admin/src/scripts/template-ldif2db.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-ldif2db.pl.in,v <-- template-ldif2db.pl.in new revision: 1.5; previous revision: 1.4 done Checking in ldap/admin/src/scripts/template-ns-accountstatus.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-ns-accountstatus.pl.in,v <-- template-ns-accountstatus.pl.in new revision: 1.5; previous revision: 1.4 done Checking in ldap/admin/src/scripts/template-ns-activate.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-ns-activate.pl.in,v <-- template-ns-activate.pl.in new revision: 1.5; previous revision: 1.4 done Checking in ldap/admin/src/scripts/template-ns-inactivate.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-ns-inactivate.pl.in,v <-- template-ns-inactivate.pl.in new revision: 1.5; previous revision: 1.4 done Checking in ldap/admin/src/scripts/template-schema-reload.pl.in; /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-schema-reload.pl.in,v <-- template-schema-reload.pl.in new revision: 1.2; previous revision: 1.1 done
verified as Nathan suggested : as long as "-w -" prompt out for password enter, we are good. [root@mv32a-vm ~]# /usr/lib/dirsrv/slapd-mv32a-vm/bak2db.pl -w - Bind Password: Usage: /usr/lib/dirsrv/slapd-mv32a-vm/bak2db.pl [-v] -D rootdn { -w password | -w - | -j filename } : -a dirname [-t dbtype] Opts: -D rootdn - Directory Manager : -w password - Directory Manager's password : -w - - Prompt for Directory Manager's password : -j filename - Read Directory Manager's password from file : -a dirname - backup directory : -t dbtype - database type (default: ldbm database) : -n backend - name of backend instance to restore : -v - verbose [root@mv32a-vm ~]# /usr/lib/dirsrv/slapd-mv32a-vm/db2index.pl -w - Bind Password: rehag Usage: /usr/lib/dirsrv/slapd-mv32a-vm/db2index.pl [-v] -D rootdn { -w password | -w - | -j filename } -n instance [-t attributeName[:indextypes[:matchingrules]]] Opts: -D rootdn - Directory Manager : -w password - Directory Manager's password : -w - - Prompt for Directory Manager's password : -j filename - Read Directory Manager's password from file : -n instance - instance to be indexed : -t attributeName[:indextypes[:matchingrules]] - attributeName: name of the attribute to be indexed If omitted, all the indexes defined for that instance are generated. - indextypes: comma separated index types - matchingrules: comma separated matrules Example: -t foo:eq,pres : -T vlvAttributeName - vlvAttributeName: name of the vlv attribute to be indexed : -v - verbose
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2009-0455.html