summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-05-01 08:05:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:24 -0500
commitbb6e2059ee0b07d15ef3f924a137321d5fd6aa0f (patch)
tree44a80422a0b93012d5908b4839a097c2de22a628 /source4/rpc_server
parent14b73135430d7636e418746529ba2d38f8e9de6f (diff)
downloadsamba-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')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c24
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c26
2 files changed, 35 insertions, 15 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();
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 968328fe9d..9934a502de 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -1741,7 +1741,7 @@ static NTSTATUS samr_QueryGroupMember(struct dcesrv_call_state *dce_call, TALLOC
struct samr_account_state *a_state;
struct ldb_message **res;
struct ldb_message_element *el;
- struct samr_ridArray *array;
+ struct samr_RidTypeArray *array;
const char * const attrs[2] = { "member", NULL };
int ret;
@@ -1757,7 +1757,7 @@ static NTSTATUS samr_QueryGroupMember(struct dcesrv_call_state *dce_call, TALLOC
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- array = talloc(mem_ctx, struct samr_ridArray);
+ array = talloc(mem_ctx, struct samr_RidTypeArray);
if (array == NULL)
return NT_STATUS_NO_MEMORY;
@@ -1776,9 +1776,9 @@ static NTSTATUS samr_QueryGroupMember(struct dcesrv_call_state *dce_call, TALLOC
if (array->rids == NULL)
return NT_STATUS_NO_MEMORY;
- array->unknown = talloc_array(mem_ctx, uint32_t,
- el->num_values);
- if (array->unknown == NULL)
+ array->types = talloc_array(mem_ctx, uint32_t,
+ el->num_values);
+ if (array->types == NULL)
return NT_STATUS_NO_MEMORY;
for (i=0; i<el->num_values; i++) {
@@ -1797,7 +1797,7 @@ static NTSTATUS samr_QueryGroupMember(struct dcesrv_call_state *dce_call, TALLOC
if (array->rids[i] == 0)
return NT_STATUS_INTERNAL_DB_CORRUPTION;
- array->unknown[i] = 7; /* Not sure what this is.. */
+ array->types[i] = 7; /* RID type of some kind, not sure what the value means. */
}
}
@@ -2809,7 +2809,7 @@ static NTSTATUS samr_GetGroupsForUser(struct dcesrv_call_state *dce_call, TALLOC
struct ldb_message **res;
struct dom_sid *domain_sid;
const char * const attrs[2] = { "objectSid", NULL };
- struct samr_RidArray *array;
+ struct samr_RidWithTypeArray *array;
int count;
DCESRV_PULL_HANDLE(h, r->in.user_handle, SAMR_HANDLE_USER);
@@ -2829,19 +2829,19 @@ static NTSTATUS samr_GetGroupsForUser(struct dcesrv_call_state *dce_call, TALLOC
if (count < 0)
return NT_STATUS_INTERNAL_DB_CORRUPTION;
- array = talloc(mem_ctx, struct samr_RidArray);
+ array = talloc(mem_ctx, struct samr_RidWithTypeArray);
if (array == NULL)
return NT_STATUS_NO_MEMORY;
array->count = 0;
- array->rid = NULL;
+ array->rids = NULL;
if (count > 0) {
int i;
- array->rid = talloc_array(mem_ctx, struct samr_RidType,
+ array->rids = talloc_array(mem_ctx, struct samr_RidWithType,
count);
- if (array->rid == NULL)
+ if (array->rids == NULL)
return NT_STATUS_NO_MEMORY;
for (i=0; i<count; i++) {
@@ -2854,9 +2854,9 @@ static NTSTATUS samr_GetGroupsForUser(struct dcesrv_call_state *dce_call, TALLOC
continue;
}
- array->rid[array->count].rid =
+ array->rids[array->count].rid =
group_sid->sub_auths[group_sid->num_auths-1];
- array->rid[array->count].type = 7;
+ array->rids[array->count].type = 7;
array->count += 1;
}
}