1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-28 12:23:49 +03:00

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 commit is contained in:
Luke Leighton
-
parent 6d14db6a6c
commit ad58cdfac6
6 changed files with 30 additions and 31 deletions

View File

@@ -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 */