From: Herb Lewis Date: Tue, 24 Apr 2001 16:44:28 +0000 (+0000) Subject: don't allow both add and delete user to be set at the same time X-Git-Tag: samba-2.2.5pre1~2226^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9db84de46a3823878c2a9356ac4ae4fd179d5847;p=thirdparty%2Fsamba.git don't allow both add and delete user to be set at the same time --- diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c index 94bfe464e4e..411d89f3f14 100644 --- a/source/utils/smbpasswd.c +++ b/source/utils/smbpasswd.c @@ -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(); }