diff options
author | Simo Sorce <idra@samba.org> | 2003-06-22 10:09:52 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2003-06-22 10:09:52 +0000 |
commit | f5974dfaae680d98b78d600cd1f1aaece332a085 (patch) | |
tree | bd24ad803125c21cdb82a27d051e0029cb21ad65 /source3/auth | |
parent | 4830a878455fe0e525aa3bd2a59e55d1f30bddad (diff) | |
download | samba-f5974dfaae680d98b78d600cd1f1aaece332a085.tar.gz samba-f5974dfaae680d98b78d600cd1f1aaece332a085.tar.bz2 samba-f5974dfaae680d98b78d600cd1f1aaece332a085.zip |
Found out a good number of NT_STATUS_IS_ERR used the wrong way.
As abartlet rememberd me NT_STATUS_IS_ERR != !NT_STATUS_IS_OK
This patch will cure the problem.
Working on this one I found 16 functions where I think NT_STATUS_IS_ERR() is
used correctly, but I'm not 100% sure, coders should check the use of
NT_STATUS_IS_ERR() in samba is ok now.
Simo.
(This used to be commit c501e84d412563eb3f674f76038ec48c2b458687)
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_rhosts.c | 2 | ||||
-rw-r--r-- | source3/auth/auth_util.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source3/auth/auth_rhosts.c b/source3/auth/auth_rhosts.c index 2f0de6b81e..8fec760e21 100644 --- a/source3/auth/auth_rhosts.c +++ b/source3/auth/auth_rhosts.c @@ -139,7 +139,7 @@ static BOOL check_hosts_equiv(SAM_ACCOUNT *account) char *fname = NULL; fname = lp_hosts_equiv(); - if (NT_STATUS_IS_ERR(sid_to_uid(pdb_get_user_sid(account), &uid))) + if (!NT_STATUS_IS_OK(sid_to_uid(pdb_get_user_sid(account), &uid))) return False; /* note: don't allow hosts.equiv on root */ diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index f7b46465f7..7d0f44f1d1 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -607,10 +607,10 @@ NT_USER_TOKEN *create_nt_token(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN *token; int i; - if (NT_STATUS_IS_ERR(uid_to_sid(&user_sid, uid))) { + if (!NT_STATUS_IS_OK(uid_to_sid(&user_sid, uid))) { return NULL; } - if (NT_STATUS_IS_ERR(gid_to_sid(&group_sid, gid))) { + if (!NT_STATUS_IS_OK(gid_to_sid(&group_sid, gid))) { return NULL; } @@ -621,7 +621,7 @@ NT_USER_TOKEN *create_nt_token(uid_t uid, gid_t gid, int ngroups, gid_t *groups, } for (i = 0; i < ngroups; i++) { - if (NT_STATUS_IS_ERR(gid_to_sid(&(group_sids)[i], (groups)[i]))) { + if (!NT_STATUS_IS_OK(gid_to_sid(&(group_sids)[i], (groups)[i]))) { DEBUG(1, ("create_nt_token: failed to convert gid %ld to a sid!\n", (long int)groups[i])); SAFE_FREE(group_sids); return NULL; @@ -695,7 +695,7 @@ static NTSTATUS get_user_groups_from_local_sam(const char *username, uid_t uid, *n_groups = n_unix_groups; for (i = 0; i < *n_groups; i++) { - if (NT_STATUS_IS_ERR(gid_to_sid(&(*groups)[i], (*unix_groups)[i]))) { + if (!NT_STATUS_IS_OK(gid_to_sid(&(*groups)[i], (*unix_groups)[i]))) { DEBUG(1, ("get_user_groups_from_local_sam: failed to convert gid %ld to a sid!\n", (long int)(*unix_groups)[i+1])); SAFE_FREE(*groups); SAFE_FREE(*unix_groups); |