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 | 3e6519da22628ea41025711718ec23b082ef02d0 (patch) | |
tree | ad34456457316a60ddd3741ef050df59ff0d70f1 /source | |
parent | fc4e0148ebf8ea45e4410224218c0c987965d36c (diff) | |
download | samba-3e6519da22628ea41025711718ec23b082ef02d0.tar.gz samba-3e6519da22628ea41025711718ec23b082ef02d0.tar.xz samba-3e6519da22628ea41025711718ec23b082ef02d0.zip |
added "start index" skipping into querydispinfo.
Diffstat (limited to 'source')
-rw-r--r-- | source/rpc_server/srv_samr.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source/rpc_server/srv_samr.c b/source/rpc_server/srv_samr.c index 1b159cd65d0..f82a1f5afeb 100644 --- a/source/rpc_server/srv_samr.c +++ b/source/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); |