diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-08-21 11:18:25 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-08-21 11:18:25 +0000 |
commit | e45720be141e0a8f112446b24b3f95fa98d2a6a2 (patch) | |
tree | 3bd31c7f9f38b8f83130236b97395756b2fbaeef /source3/passdb | |
parent | e47acb0147fa5e215a872f69984fb80515dd0c97 (diff) | |
download | samba-e45720be141e0a8f112446b24b3f95fa98d2a6a2.tar.gz samba-e45720be141e0a8f112446b24b3f95fa98d2a6a2.tar.bz2 samba-e45720be141e0a8f112446b24b3f95fa98d2a6a2.zip |
Use the 'init' flag to determine if the UID is set, rather than testing the
uid for -1.
Andrew Bartlett
(This used to be commit 2fc12864ae78ea08d8cb4e3b1c7e341ca4a854e6)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/passdb.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index a9c6f0729b..7a8c40346f 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -823,11 +823,14 @@ BOOL local_sid_to_uid(uid_t *puid, const DOM_SID *psid, enum SID_NAME_USE *name_ return False; if (pdb_getsampwsid(sam_user, psid)) { - *puid = pdb_get_uid(sam_user); - if (*puid == -1) { + + if (!(pdb_get_init_flag(sam_user) & FLAG_SAM_UID)) { pdb_free_sam(&sam_user); return False; } + + *puid = pdb_get_uid(sam_user); + DEBUG(10,("local_sid_to_uid: SID %s -> uid (%u) (%s).\n", sid_to_string( str, psid), (unsigned int)*puid, pdb_get_username(sam_user))); pdb_free_sam(&sam_user); |