r22717: Add Everyone and AuthenticatedUsers to the user's token
authorGerald Carter <jerry@samba.org>
Sun, 6 May 2007 21:17:02 +0000 (21:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:21:50 +0000 (12:21 -0500)
for use by the require-membership-of pam_winbind option.
(This used to be commit 11f81c5997a014cca9d98c474e7870ebb07c4642)

source3/nsswitch/winbindd_pam.c

index d9c9fe91cb30aca7da5df9697ce555d123ecdccf..66ac61e5c9db96a54290681830b819a09f45d82b 100644 (file)
@@ -128,7 +128,11 @@ static NTSTATUS check_info3_in_group(TALLOC_CTX *mem_ctx,
        DOM_SID *require_membership_of_sid;
        size_t num_require_membership_of_sid;
        DOM_SID *all_sids;
-       size_t num_all_sids = (2 + info3->num_groups2 + info3->num_other_sids);
+       /* UserSID, GroupSID, Grooup2SIDs, OtherSIDs, WellKnownSIDs */
+       size_t num_all_sids = (2 + 
+                              info3->num_groups2 + 
+                              info3->num_other_sids + 
+                              2 );
        size_t i, j = 0, k;
        size_t group_sid_length;
        const char *search_location;
@@ -213,6 +217,11 @@ static NTSTATUS check_info3_in_group(TALLOC_CTX *mem_ctx,
        }
        j++;    
 
+       /* Well-Known SIDs */
+
+       sid_copy( &all_sids[j++], &global_sid_World );
+       sid_copy( &all_sids[j++], &global_sid_Authenticated_Users );
+       
        for (i = 0; i < info3->num_groups2; i++) {
        
                sid_copy(&all_sids[j], &(info3->dom_sid.sid));