summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-01-29 21:22:08 +0000
committerLuke Leighton <lkcl@samba.org>1999-01-29 21:22:08 +0000
commit9b5043cb2f125c39eda1e986cfcce3b534dc3b43 (patch)
tree8c23428f5f8cba9d6108a2e7a39edb68d93e47f8 /source3/rpc_server/srv_samr.c
parent5a9859c7b0e1d22cd92b3a512690c5113c1bd51b (diff)
downloadsamba-9b5043cb2f125c39eda1e986cfcce3b534dc3b43.tar.gz
samba-9b5043cb2f125c39eda1e986cfcce3b534dc3b43.tar.bz2
samba-9b5043cb2f125c39eda1e986cfcce3b534dc3b43.zip
fix for enumerate domain users (bug spotted by sean matthews).
also needed to use start index properly and generate next index. both client and server code need to recognise error code 0x105 when there's not enough room to store all the users in one call. sort this out another time. (This used to be commit ad58cdfac6b85d9431216e32e532ad4d60f9c6dd)
Diffstat (limited to 'source3/rpc_server/srv_samr.c')
-rw-r--r--source3/rpc_server/srv_samr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index 15cef476c4..1fb64c10ef 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -73,7 +73,10 @@ static BOOL get_sampwd_entries(SAM_USER_INFO_21 *pw_buf,
/* skip the requested number of entries.
not very efficient, but hey...
*/
- start_idx--;
+ if (acb_mask == 0 || IS_BITS_SET_SOME(pwd->acct_ctrl, acb_mask))
+ {
+ start_idx--;
+ }
continue;
}
@@ -344,11 +347,12 @@ static void samr_reply_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_u,
DEBUG(5,("samr_reply_enum_dom_users: %d\n", __LINE__));
become_root(True);
- get_sampwd_entries(pass, 0, &total_entries, &num_entries, MAX_SAM_ENTRIES, q_u->acb_mask);
+ get_sampwd_entries(pass, q_u->start_idx, &total_entries, &num_entries,
+ MAX_SAM_ENTRIES, q_u->acb_mask);
unbecome_root(True);
make_samr_r_enum_dom_users(&r_e,
- 0x00000000, num_entries,
+ q_u->start_idx + num_entries, num_entries,
pass, r_e.status);
/* store the response in the SMB stream */