Doesn't re-prompt for password when it is specified on the cmdline
authorJim McDonough <jmcd@samba.org>
Fri, 11 Jul 2003 14:33:03 +0000 (14:33 +0000)
committerJim McDonough <jmcd@samba.org>
Fri, 11 Jul 2003 14:33:03 +0000 (14:33 +0000)
(This used to be commit 6ebe87d318658f28ad9b9f8169fc4400856d5812)

source3/utils/smbpasswd.c

index 2781e630f5e59512b8189320a29aa76bd558bdfb..fac161775286a87a9a396d73534c41e9fcb93798 100644 (file)
@@ -420,7 +420,7 @@ static int process_root(int local_flags)
        } else if (local_flags & LOCAL_INTERDOM_ACCOUNT) {
                static fstring buf;
 
-               if (local_flags & LOCAL_ADD_USER) {
+               if (local_flags & LOCAL_ADD_USER & !new_passwd) {
                        /*
                         * Prompt for trusting domain's account password
                         */
@@ -465,7 +465,7 @@ static int process_root(int local_flags)
                        }
                }
                
-               if(local_flags & LOCAL_SET_PASSWORD) {
+               if(local_flags & LOCAL_SET_PASSWORD & !new_passwd) {
                        new_passwd = prompt_for_new_password(stdin_passwd_get);
                        
                        if(!new_passwd) {