summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-04-10 17:12:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:35 -0500
commit110d86876eef65c838105f7365e50c77c3a02a30 (patch)
treedc446534a0c8e493992924e36ad70c5422d7ef9a /source3
parentdded66808dab60c4e64e5401a5cb8b1605e29f0e (diff)
downloadsamba-110d86876eef65c838105f7365e50c77c3a02a30.tar.gz
samba-110d86876eef65c838105f7365e50c77c3a02a30.tar.bz2
samba-110d86876eef65c838105f7365e50c77c3a02a30.zip
r6282: Before converting enum_dom_groups, better get the previous version a bit
closer to being correct. 'svn blame' shows CVSIN, but somehow I get the feeling this is my code... Volker (This used to be commit 5d34bd617535a26ae121a72add41dc7b8cec4580)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_samr_nt.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 2384ddb9d3..84c78eab64 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -864,6 +864,7 @@ static NTSTATUS get_group_domain_entries( TALLOC_CTX *ctx,
int i;
uint32 group_entries = 0;
uint32 num_entries = 0;
+ NTSTATUS result = NT_STATUS_OK;
*p_num_entries = 0;
@@ -881,6 +882,7 @@ static NTSTATUS get_group_domain_entries( TALLOC_CTX *ctx,
if (num_entries>max_entries) {
DEBUG(5,("Limiting to %d entries\n", max_entries));
num_entries=max_entries;
+ result = STATUS_MORE_ENTRIES;
}
*d_grp=TALLOC_ZERO_ARRAY(ctx, DOMAIN_GRP, num_entries);
@@ -903,7 +905,7 @@ static NTSTATUS get_group_domain_entries( TALLOC_CTX *ctx,
DEBUG(10,("get_group_domain_entries: returning %d entries\n",
*p_num_entries));
- return NT_STATUS_OK;
+ return result;
}
/*******************************************************************
@@ -970,13 +972,19 @@ NTSTATUS _samr_enum_dom_groups(pipes_struct *p, SAMR_Q_ENUM_DOM_GROUPS *q_u, SAM
DEBUG(5,("samr_reply_enum_dom_groups: %d\n", __LINE__));
/* the domain group array is being allocated in the function below */
- if (!NT_STATUS_IS_OK(r_u->status = get_group_domain_entries(p->mem_ctx, &grp, &sid, q_u->start_idx, &num_entries, MAX_SAM_ENTRIES))) {
+ r_u->status = get_group_domain_entries(p->mem_ctx, &grp, &sid,
+ q_u->start_idx, &num_entries,
+ MAX_SAM_ENTRIES);
+
+ if (!NT_STATUS_IS_OK(r_u->status) &&
+ !NT_STATUS_EQUAL(r_u->status, STATUS_MORE_ENTRIES))
return r_u->status;
- }
- make_group_sam_entry_list(p->mem_ctx, &r_u->sam, &r_u->uni_grp_name, num_entries, grp);
+ make_group_sam_entry_list(p->mem_ctx, &r_u->sam, &r_u->uni_grp_name,
+ num_entries, grp);
- init_samr_r_enum_dom_groups(r_u, q_u->start_idx, num_entries);
+ init_samr_r_enum_dom_groups(r_u, q_u->start_idx+num_entries,
+ num_entries);
DEBUG(5,("samr_enum_dom_groups: %d\n", __LINE__));