diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-05-01 08:05:17 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:16:24 -0500 |
commit | bb6e2059ee0b07d15ef3f924a137321d5fd6aa0f (patch) | |
tree | 44a80422a0b93012d5908b4839a097c2de22a628 /source4/rpc_server/netlogon/dcerpc_netlogon.c | |
parent | 14b73135430d7636e418746529ba2d38f8e9de6f (diff) | |
download | samba-bb6e2059ee0b07d15ef3f924a137321d5fd6aa0f.tar.gz samba-bb6e2059ee0b07d15ef3f924a137321d5fd6aa0f.tar.bz2 samba-bb6e2059ee0b07d15ef3f924a137321d5fd6aa0f.zip |
r6544: Use common structures between SAMR, NETLGON and the Krb5 PAC.
Fill out the group list for the SamLogon reply, so clients get the
supplementary groups.
Andrew Bartlett
(This used to be commit d9c31e60a72c345e3a23a7eb742906bcfc18721c)
Diffstat (limited to 'source4/rpc_server/netlogon/dcerpc_netlogon.c')
-rw-r--r-- | source4/rpc_server/netlogon/dcerpc_netlogon.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 141aeef1bf..6c32ac8b2c 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -522,8 +522,28 @@ static NTSTATUS netr_LogonSamLogonEx(struct dcesrv_call_state *dce_call, TALLOC_ sam->bad_password_count = sam->bad_password_count; sam->rid = server_info->account_sid->sub_auths[server_info->account_sid->num_auths-1]; sam->primary_gid = server_info->primary_group_sid->sub_auths[server_info->primary_group_sid->num_auths-1]; - sam->group_count = 0; - sam->groupids = NULL; + + sam->groups.count = 0; + sam->groups.rids = NULL; + + if (server_info->n_domain_groups > 0) { + int i; + sam->groups.rids = talloc_array(mem_ctx, struct samr_RidWithType, + server_info->n_domain_groups); + + if (sam->groups.rids == NULL) + return NT_STATUS_NO_MEMORY; + + for (i=0; i<server_info->n_domain_groups; i++) { + + struct dom_sid *group_sid = server_info->domain_groups[i]; + sam->groups.rids[sam->groups.count].rid = + group_sid->sub_auths[group_sid->num_auths-1]; + sam->groups.rids[sam->groups.count].type = 7; + sam->groups.count += 1; + } + } + sam->user_flags = 0; /* TODO: w2k3 uses 0x120 - what is this? */ sam->acct_flags = server_info->acct_flags; sam->logon_server.string = lp_netbios_name(); |