summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-03-19 22:16:19 +0000
committerAndrew Tridgell <tridge@samba.org>2002-03-19 22:16:19 +0000
commit160358413797c038761d58ca3081df7c67aac28b (patch)
tree3a35d772262ef8235a240e50fb628fe56bb73772
parent7b50eef89e06ab58aeeb2377342933f4bf505f1e (diff)
downloadsamba-160358413797c038761d58ca3081df7c67aac28b.tar.gz
samba-160358413797c038761d58ca3081df7c67aac28b.tar.bz2
samba-160358413797c038761d58ca3081df7c67aac28b.zip
make "net ads user" and "net ads group" also use the new paged interface
(This used to be commit 98769f08e723c616a98a2f0c427e9b0e22b28be9)
-rw-r--r--source3/utils/net_ads.c46
1 files changed, 16 insertions, 30 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 31bf38726b..54d8eccbd7 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -125,26 +125,19 @@ static int net_ads_user(int argc, const char **argv)
ADS_STRUCT *ads;
ADS_STATUS rc;
void *res;
- int rescount;
- void *cookie = NULL;
const char *attrs[] = {"sAMAccountName", "name", "objectSid", NULL};
if (!(ads = ads_startup())) return -1;
- do {
- rc = ads_do_paged_search(ads, ads->bind_path,
- LDAP_SCOPE_SUBTREE,
- "(objectclass=user)", attrs, &res,
- &rescount, &cookie);
-
- if (!ADS_ERR_OK(rc)) {
- d_printf("ads_search: %s\n", ads_errstr(rc));
- return -1;
- }
- ads_dump(ads, res);
-
- } while (cookie);
+ rc = ads_do_search_all(ads, ads->bind_path,
+ LDAP_SCOPE_SUBTREE,
+ "(objectclass=user)", attrs, &res);
+ if (!ADS_ERR_OK(rc)) {
+ d_printf("ads_search: %s\n", ads_errstr(rc));
+ return -1;
+ }
+ ads_dump(ads, res);
ads_destroy(&ads);
return 0;
}
@@ -154,26 +147,19 @@ static int net_ads_group(int argc, const char **argv)
ADS_STRUCT *ads;
ADS_STATUS rc;
void *res;
- int rescount;
- void *cookie = NULL;
const char *attrs[] = {"sAMAccountName", "name", "objectSid", NULL};
if (!(ads = ads_startup())) return -1;
- do {
- rc = ads_do_paged_search(ads, ads->bind_path,
- LDAP_SCOPE_SUBTREE,
- "(objectclass=group)", attrs, &res,
- &rescount, &cookie);
-
- if (!ADS_ERR_OK(rc)) {
- d_printf("ads_search: %s\n", ads_errstr(rc));
- return -1;
- }
- ads_dump(ads, res);
-
- } while (cookie);
+ rc = ads_do_search_all(ads, ads->bind_path,
+ LDAP_SCOPE_SUBTREE,
+ "(objectclass=group)", attrs, &res);
+ if (!ADS_ERR_OK(rc)) {
+ d_printf("ads_search: %s\n", ads_errstr(rc));
+ return -1;
+ }
+ ads_dump(ads, res);
ads_destroy(&ads);
return 0;
}