diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-09 00:42:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:49 -0500 |
commit | 1d5c2c364e3fab4d10ccc3765cbb467095229b84 (patch) | |
tree | f464b76a406a59cec0cfadc615167bade243b145 /source4 | |
parent | 961060351e3e3a3bfeb41c8d238babd349926ebf (diff) | |
download | samba-1d5c2c364e3fab4d10ccc3765cbb467095229b84.tar.gz samba-1d5c2c364e3fab4d10ccc3765cbb467095229b84.tar.bz2 samba-1d5c2c364e3fab4d10ccc3765cbb467095229b84.zip |
r595: nicer handling on max_size multiplier
(This used to be commit 994baba7ebc267cb3051109aee022d71472aa6b6)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index 20460ba172..9de81c33e5 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -647,7 +647,7 @@ static NTSTATUS samr_EnumDomainUsers(struct dcesrv_call_state *dce_call, TALLOC_ if (count == -1) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } - if (count == 0) { + if (count == 0 || r->in.max_size == 0) { return NT_STATUS_OK; } @@ -677,7 +677,8 @@ static NTSTATUS samr_EnumDomainUsers(struct dcesrv_call_state *dce_call, TALLOC_ /* return the rest, limit by max_size. Note that we use the w2k3 element size value of 54 */ r->out.num_entries = count - first; - r->out.num_entries = MIN(r->out.num_entries, 1+(r->in.max_size/54)); + r->out.num_entries = MIN(r->out.num_entries, + 1+(r->in.max_size/SAMR_ENUM_USERS_MULTIPLIER)); r->out.sam = talloc_p(mem_ctx, struct samr_SamArray); if (!r->out.sam) { |