diff options
author | Volker Lendecke <vlendec@samba.org> | 2003-02-07 08:03:37 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2003-02-07 08:03:37 +0000 |
commit | 13f65125ac8bcbb3b3367ec6feab504272fb388f (patch) | |
tree | f01a0020deaf66923e732810f55aad34973f9c63 /source3/utils | |
parent | 51bf3e0b76bc8269ce54a2be57bb2a876e687fb4 (diff) | |
download | samba-13f65125ac8bcbb3b3367ec6feab504272fb388f.tar.gz samba-13f65125ac8bcbb3b3367ec6feab504272fb388f.tar.bz2 samba-13f65125ac8bcbb3b3367ec6feab504272fb388f.zip |
Invert flag testing
(This used to be commit 05397c526d2fad63faee781cc68934c58ee97500)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/pdbedit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index 3b7f59ff2a..9df10c21a4 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -260,17 +260,19 @@ static int set_user_info (struct pdb_context *in, const char *username, pdb_set_profile_path (sam_pwent, profile, PDB_CHANGED); if (account_control) { - uint16 types = ACB_NORMAL|ACB_MNS|ACB_DOMTRUST|ACB_WSTRUST|ACB_SVRTRUST; + uint16 not_settable = ~(ACB_DISABLED|ACB_HOMDIRREQ|ACB_PWNOTREQ| + ACB_PWNOEXP|ACB_AUTOLOCK); + uint16 newflag = pdb_decode_acct_ctrl(account_control); - if (newflag & types) { + if (newflag & not_settable) { fprintf(stderr, "Can only set [NDHLX] flags\n"); pdb_free_sam(&sam_pwent); return -1; } pdb_set_acct_ctrl(sam_pwent, - (pdb_get_acct_ctrl(sam_pwent) & types) | newflag, + (pdb_get_acct_ctrl(sam_pwent) & not_settable) | newflag, PDB_CHANGED); } |