]> git.sur5r.net Git - openldap/commitdiff
Add -y support from HEAD
authorKurt Zeilenga <kurt@openldap.org>
Mon, 14 Apr 2003 17:37:27 +0000 (17:37 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 14 Apr 2003 17:37:27 +0000 (17:37 +0000)
clients/tools/ldappasswd.c

index 85ef979468d08218b322fac05e3586d6d8e36472..b6a1ec3168691d164fd5386c021d0934e3dd5e77 100644 (file)
@@ -211,8 +211,13 @@ main( int argc, char *argv[] )
 
        if( 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 = getpassphrase( "Enter LDAP Password: " );
+                       passwd.bv_len = passwd.bv_val ? strlen( passwd.bv_val ) : 0;
+               }
        }
 
        ld = tool_conn_setup( 0, 0 );