diff options
author | Luke Leighton <lkcl@samba.org> | 1998-10-21 18:06:46 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-10-21 18:06:46 +0000 |
commit | 5b7df7a7529f28c21addf7666bc2106ed2848990 (patch) | |
tree | 0465ea645e9077f1465955151d0b6a618893bb6c /source3/rpc_server | |
parent | 88a0a8c088adc0a8750865f78573ba1c59813101 (diff) | |
download | samba-5b7df7a7529f28c21addf7666bc2106ed2848990.tar.gz samba-5b7df7a7529f28c21addf7666bc2106ed2848990.tar.bz2 samba-5b7df7a7529f28c21addf7666bc2106ed2848990.zip |
added "start index" skipping into querydispinfo.
(This used to be commit 3e6519da22628ea41025711718ec23b082ef02d0)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_samr.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 1b159cd65d..f82a1f5afe 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -41,6 +41,7 @@ extern rid_name domain_alias_rids[]; ********************************************************************/ static BOOL get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, + int start_idx, int *total_entries, int *num_entries, int max_num_entries, uint16 acb_mask) @@ -62,7 +63,18 @@ static BOOL get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, while (((pwd = getsam21pwent(vp)) != NULL) && (*num_entries) < max_num_entries) { - int user_name_len = strlen(pwd->smb_name); + int user_name_len; + + if (start_idx > 0) + { + /* skip the requested number of entries. + not very efficient, but hey... + */ + start_idx--; + continue; + } + + user_name_len = strlen(pwd->smb_name); make_unistr2(&(pw_buf[(*num_entries)].uni_user_name), pwd->smb_name, user_name_len-1); make_uni_hdr(&(pw_buf[(*num_entries)].hdr_user_name), user_name_len-1, user_name_len-1, 1); @@ -302,7 +314,7 @@ 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, &total_entries, &num_entries, MAX_SAM_ENTRIES, q_u->acb_mask); + get_sampwd_entries(pass, 0, &total_entries, &num_entries, MAX_SAM_ENTRIES, q_u->acb_mask); unbecome_root(True); make_samr_r_enum_dom_users(&r_e, total_entries, @@ -473,7 +485,7 @@ static void samr_reply_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_u, if (r_e.status == 0x0) { become_root(True); - got_pwds = get_sampwd_entries(pass, &total_entries, &num_entries, MAX_SAM_ENTRIES, 0); + got_pwds = get_sampwd_entries(pass, q_u->start_idx, &total_entries, &num_entries, MAX_SAM_ENTRIES, 0); unbecome_root(True); switch (q_u->switch_level) @@ -943,13 +955,11 @@ static BOOL get_user_info_21(SAM_USER_INFO_21 *id21, uint32 user_rid) LOGON_HRS hrs; int i; -#ifdef DONT_CHECK_THIS_FOR_NOW if (!pdb_rid_is_user(user_rid)) { DEBUG(4,("RID 0x%x is not a user RID\n", user_rid)); return False; } -#endif become_root(True); sam_pass = getsam21pwrid(user_rid); |