r22066: Ensure that winbind can resolve SIDs in the S-1-22-{1,2}
authorGerald Carter <jerry@samba.org>
Wed, 4 Apr 2007 02:57:01 +0000 (02:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:09 +0000 (12:19 -0500)
domain to a uid.gid using the idmap_passdb backend.
(This used to be commit fc1aeee52d8cb6c8d5d306dbbec18127bd2674bc)

source3/nsswitch/idmap.c
source3/passdb/pdb_interface.c

index c2a38fa979720fc4da12536f201ee19eb3742300..104be86777fb2d693ca32e530261532ab87471e2 100644 (file)
@@ -689,7 +689,9 @@ static struct idmap_domain* find_idmap_domain_from_sid( DOM_SID *account_sid )
 
        if ( (pdb_dom_num != -1) && 
             (sid_check_is_in_builtin(account_sid) ||
-             sid_check_is_in_wellknown_domain(account_sid)) ) 
+             sid_check_is_in_wellknown_domain(account_sid) ||
+             sid_check_is_in_unix_groups(account_sid) ||
+             sid_check_is_in_unix_users(account_sid)) ) 
        {
                return idmap_domains[pdb_dom_num];
        }
index e0b9086f9cceed9a98566061bbb90009835b12dc..387e3fecdee4c9223bbcb62fd63882795767db63 100644 (file)
@@ -1305,6 +1305,26 @@ static BOOL pdb_default_sid_to_id(struct pdb_methods *methods,
                goto done;
        }
 
+       /* check for "Unix User" */
+
+       if ( sid_peek_check_rid(&global_sid_Unix_Users, sid, &rid) ) {
+               id->uid = rid;
+               *type = SID_NAME_USER;
+               ret = True;             
+               goto done;              
+       }
+       
+       /* check for "Unix User" */
+
+       if ( sid_peek_check_rid(&global_sid_Unix_Groups, sid, &rid) ) {
+               id->gid = rid;
+               *type = SID_NAME_ALIAS;
+               ret = True;             
+               goto done;              
+       }
+       
+       /* BUILTIN */
+
        if (sid_check_is_in_builtin(sid) ||
            sid_check_is_in_wellknown_domain(sid)) {
                /* Here we only have aliases */
@@ -1328,7 +1348,7 @@ static BOOL pdb_default_sid_to_id(struct pdb_methods *methods,
                goto done;
        }
 
-       DEBUG(5, ("Sid %s is neither ours nor builtin, don't know it\n",
+       DEBUG(5, ("Sid %s is neither ours, a Unix SID, nor builtin\n",
                  sid_string_static(sid)));
 
  done: