s3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT token.
commitc9703c96deaf8b08ed6d10db94585f4be45935bb
authorJeremy Allison <jra@samba.org>
Tue, 25 Mar 2014 15:47:39 +0000 (25 08:47 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 4 Apr 2014 19:01:51 +0000 (4 21:01 +0200)
tree8db8823c0e08565c1fbb94741e91aac0cb5c53a3
parent34fcb4e542ec61154a14c546a98fa096ab747eeb
s3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT token.

This has to be done in every code path that creates
an NT token, as remote users may have been added to
the local /etc/group database. Tokens created merely
from the info3 structs (via the DC or via the krb5 PAC)
won't have these local groups.

This code needs to special-case the guest user, as
this token can have the token_sid[0] set to the Guest
SID, not the mapping of UNIX uid -> SID.

Other users that may have a well-known SID
set in token_sid[0] (like SYSTEM) are usually
not mappable to UNIX users and can be ignored
when adding local groups from /etc/group.

Combined back-port of fixes
6034ab521c47fc5f4732398652c9c6847ff92035 and
a9fa09723bee3588db2168ac13f7ad0334452c11 from
master.

https://bugzilla.samba.org/show_bug.cgi?id=10508

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/auth/token_util.c