From: Kurt Zeilenga Date: Sat, 12 Apr 2003 03:46:45 +0000 (+0000) Subject: Add -y support X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~385 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a255dbb9e9dd05af7b6747f9549de86e3e020b32;p=openldap Add -y support --- diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index e4353b13ea..0551229f80 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -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 );