Use the 'init' flag to determine if the UID is set, rather than testing the
authorAndrew Bartlett <abartlet@samba.org>
Wed, 21 Aug 2002 11:18:25 +0000 (11:18 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 21 Aug 2002 11:18:25 +0000 (11:18 +0000)
uid for -1.

Andrew Bartlett
(This used to be commit 2fc12864ae78ea08d8cb4e3b1c7e341ca4a854e6)

source3/passdb/passdb.c

index a9c6f0729bd0e60627c5880b461c4de7e03c24bb..7a8c40346faa52b446ad4ec25e877b4d7a3b610b 100644 (file)
@@ -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);