don't allow both add and delete user to be set at the same time
authorHerb Lewis <herb@samba.org>
Tue, 24 Apr 2001 16:44:28 +0000 (16:44 +0000)
committerHerb Lewis <herb@samba.org>
Tue, 24 Apr 2001 16:44:28 +0000 (16:44 +0000)
(This used to be commit 9db84de46a3823878c2a9356ac4ae4fd179d5847)

source3/utils/smbpasswd.c

index 94bfe464e4e9addcd78852aeee35a86260a0bee9..411d89f3f14feb84b1b7f4432ff8b370d8a554dd 100644 (file)
@@ -319,10 +319,13 @@ static int process_root(int argc, char *argv[])
        argv += optind;
 
        /*
+        * Ensure both add/delete user are not set
         * Ensure add/delete user and either remote machine or join domain are
         * not both set.
         */     
-       if((local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER)) && ((remote_machine != NULL) || joining_domain)) {
+       if(((local__flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER)) == (LOCAL_ADD_USER|LOCAL_DELETE_USER)) || 
+          ((local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER)) && 
+               ((remote_machine != NULL) || joining_domain))) {
                usage();
        }