]> git.sur5r.net Git - openldap/commitdiff
Add -y support
authorKurt Zeilenga <kurt@openldap.org>
Sat, 12 Apr 2003 03:46:45 +0000 (03:46 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 12 Apr 2003 03:46:45 +0000 (03:46 +0000)
clients/tools/ldappasswd.c

index e4353b13ea3cb06e218ea86cb5ac19b56d4f99ca..0551229f8002d6e210b9684cb942647ccadef06b 100644 (file)
@@ -208,9 +208,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 );