summaryrefslogtreecommitdiffstats
path: root/source/auth
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-03-10 08:26:40 +0000
committerGünther Deschner <gd@samba.org>2006-03-10 08:26:40 +0000
commit5234438979d07fa01d14aafd8cbb14bc661684a5 (patch)
tree9b5ced48bb3f1647c12ce454fe86791d56e04b26 /source/auth
parent5949d67f93c488fe6b8aca7a16061c0404c83e29 (diff)
downloadsamba-5234438979d07fa01d14aafd8cbb14bc661684a5.tar.gz
samba-5234438979d07fa01d14aafd8cbb14bc661684a5.tar.xz
samba-5234438979d07fa01d14aafd8cbb14bc661684a5.zip
r14129: Add the group sids from the Kerberos PAC to the user token.
Guenther
Diffstat (limited to 'source/auth')
-rw-r--r--source/auth/auth_util.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index 357da1fdb74..99ce6620c31 100644
--- a/source/auth/auth_util.c
+++ b/source/auth/auth_util.c
@@ -1102,6 +1102,7 @@ NTSTATUS make_server_info_pac(auth_serversupplied_info **server_info,
DOM_SID user_sid, group_sid;
fstring dom_name;
auth_serversupplied_info *result;
+ int i;
if ( !(sampass = samu_new( NULL )) ) {
return NT_STATUS_NO_MEMORY;
@@ -1139,10 +1140,36 @@ NTSTATUS make_server_info_pac(auth_serversupplied_info **server_info,
result->uid = pwd->pw_uid;
result->gid = pwd->pw_gid;
- /* TODO: Add groups from pac */
result->sids = NULL;
result->num_sids = 0;
+ /* and create (by appending rids) the 'domain' sids */
+
+ for (i = 0; i < logon_info->info3.num_groups2; i++) {
+ DOM_SID sid;
+ if (!sid_compose(&sid, &logon_info->info3.dom_sid.sid,
+ logon_info->info3.gids[i].g_rid)) {
+ DEBUG(3,("could not append additional group rid "
+ "0x%x\n", logon_info->info3.gids[i].g_rid));
+ TALLOC_FREE(result);
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ add_sid_to_array(result, &sid, &result->sids,
+ &result->num_sids);
+ }
+
+ /* Copy 'other' sids. We need to do sid filtering here to
+ prevent possible elevation of privileges. See:
+
+ http://www.microsoft.com/windows2000/techinfo/administration/security/sidfilter.asp
+ */
+
+ for (i = 0; i < logon_info->info3.num_other_sids; i++) {
+ add_sid_to_array(result, &logon_info->info3.other_sids[i].sid,
+ &result->sids,
+ &result->num_sids);
+ }
+
*server_info = result;
return NT_STATUS_OK;