]> git.sur5r.net Git - openldap/blobdiff - clients/tools/ldappasswd.c
Changes from HEAD for beta
[openldap] / clients / tools / ldappasswd.c
index 0551229f8002d6e210b9684cb942647ccadef06b..b7b99697d5eb9d8f633623c041e82618eb8c509a 100644 (file)
@@ -166,7 +166,7 @@ main( int argc, char *argv[] )
        }
 
        if( oldpwfile ) {
-               rc = lutil_get_filed_password( prog, &oldpw );
+               rc = lutil_get_filed_password( oldpwfile, &oldpw );
                if( rc ) return EXIT_FAILURE;
        }
 
@@ -187,7 +187,7 @@ main( int argc, char *argv[] )
        }
 
        if( newpwfile ) {
-               rc = lutil_get_filed_password( prog, &newpw );
+               rc = lutil_get_filed_password( newpwfile, &newpw );
                if( rc ) return EXIT_FAILURE;
        }
 
@@ -207,22 +207,22 @@ main( int argc, char *argv[] )
                newpw.bv_len = strlen( newpw.bv_val );
        }
 
-       if( want_bindpw && passwd.bv_val == NULL ) {
-               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;
-               }
+       if ( pw_file ) {
+               rc = lutil_get_filed_password( pw_file, &passwd );
+               if( rc ) return EXIT_FAILURE;
+
+       } else if ( want_bindpw ) {
+               passwd.bv_val = getpassphrase( _("Enter LDAP Password: ") );
+               passwd.bv_len = passwd.bv_val ? strlen( passwd.bv_val ) : 0;
        }
 
        ld = tool_conn_setup( 0, 0 );
 
        tool_bind( ld );
 
-       if ( authzid || manageDSAit || noop )
+       if ( assertion || authzid || manageDSAit || noop ) {
                tool_server_controls( ld, NULL, 0 );
+       }
 
        if( user != NULL || oldpw.bv_val != NULL || newpw.bv_val != NULL ) {
                /* build change password control */