From: Kurt Zeilenga Date: Mon, 14 Apr 2003 17:37:27 +0000 (+0000) Subject: Add -y support from HEAD X-Git-Tag: OPENLDAP_REL_ENG_2_1_18~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d213c5491e04a7bcf5faaeef93500fa70c4f4bef;p=thirdparty%2Fopenldap.git Add -y support from HEAD --- diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index 85ef979468..b6a1ec3168 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -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 );