[Date Prev][Date Next] [Chronological] [Thread] [Top]

ldappasswd doesn't honor -y option (ITS#2441)



Full_Name: Karsten Kuenne
Version: 2.1.17
OS: Solaris 8
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (65.213.85.118)


The ldappasswd tool ignores the -y option. I don't know whether this is on
purpose but I needed that
functionality and added it. Following is a patch:

--- clients/tools/ldappasswd.c.orig     Fri Apr 11 16:57:57 2003
+++ clients/tools/ldappasswd.c  Fri Apr 11 17:00:03 2003
@@ -209,10 +209,15 @@
                newpw.bv_len = strlen( newpw.bv_val );
        }

-       if( want_bindpw && passwd.bv_val == NULL ) {
+       if( pw_file || ( want_bindpw && passwd.bv_val == NULL )) {
                /* handle bind password */
-               passwd.bv_val = strdup( getpassphrase("Enter bind password:
"));
-               passwd.bv_len = passwd.bv_val ? strlen( passwd.bv_val ) : 0;
+               if ( pw_file ) {
+                       rc = lutil_get_filed_password( pw_file, &passwd );
+                       if( rc ) return EXIT_FAILURE;
+               } else {
+                       passwd.bv_val = strdup( getpassphrase("Enter bind
password: "));
+                       passwd.bv_len = passwd.bv_val ? strlen( passwd.bv_val )
: 0;
+               }
        }

        ld = tool_conn_setup( 0, 0 );