r13791: Having S-1-1-0 show up in winbind lookupsid does not really make sense.
authorVolker Lendecke <vlendec@samba.org>
Thu, 2 Mar 2006 18:33:43 +0000 (18:33 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:10:54 +0000 (11:10 -0500)
Volker
(This used to be commit ae9614ce019e25fb29dad8429d93f3140c2f84ad)

source3/passdb/lookup_sid.c
source3/passdb/util_wellknown.c

index 3d1805525a14ab2c989135ed67598cd27cbd33c2..942d2771782427c01aed0474537f9c8af9b1b055 100644 (file)
@@ -1191,9 +1191,13 @@ BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid)
                goto done;
        }
 
-       if (sid_check_is_in_builtin(psid) && pdb_getgrsid(&map, *psid)) {
-               *pgid = map.gid;
-               goto done;
+       if ((sid_check_is_in_builtin(psid) ||
+            sid_check_is_in_wellknown_domain(psid))) {
+               if (pdb_getgrsid(&map, *psid)) {
+                       *pgid = map.gid;
+                       goto done;
+               }
+               return False;
        }
 
        if (sid_peek_check_rid(get_global_sam_sid(), psid, &rid)) {
index be3cf3744695005752c0c1f50b2817c8d9ba0246..9a6fa7def52cc57deb9453525076b1ce60cd19df 100644 (file)
@@ -85,6 +85,17 @@ BOOL sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name)
        return False;
 }
 
+BOOL sid_check_is_in_wellknown_domain(const DOM_SID *sid)
+{
+       DOM_SID dom_sid;
+       uint32 rid;
+
+       sid_copy(&dom_sid, sid);
+       sid_split_rid(&dom_sid, &rid);
+       
+       return sid_check_is_wellknown_domain(&dom_sid, NULL);
+}
+
 /**************************************************************************
  Looks up a known username from one of the known domains.
 ***************************************************************************/