summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-02 01:46:01 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-02 01:46:01 +0000
commit10b82d30b782ad990fc3386a8f0101641780a14e (patch)
tree862c680d264db4e55d6318601b64d3ffc466703b /source3/rpc_client
parentbd4bea62ada937c58d38f6bf7af88c4cfb4115cc (diff)
downloadsamba-10b82d30b782ad990fc3386a8f0101641780a14e.tar.gz
samba-10b82d30b782ad990fc3386a8f0101641780a14e.tar.bz2
samba-10b82d30b782ad990fc3386a8f0101641780a14e.zip
improved enumdomains added -i option.
(This used to be commit 50dc709fa95e86ebe2b3132176241cb3a2cc4e36)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/msrpc_samr.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/source3/rpc_client/msrpc_samr.c b/source3/rpc_client/msrpc_samr.c
index e1392f428f..621b218ad6 100644
--- a/source3/rpc_client/msrpc_samr.c
+++ b/source3/rpc_client/msrpc_samr.c
@@ -444,19 +444,16 @@ BOOL sam_query_dominfo(const char* srv_name,
&sam_pol) : False;
/* connect to the domain */
- res1 = res ? samr_open_domain(
- &sam_pol, ace_perms, sid1,
+ res1 = res ? samr_open_domain( &sam_pol, ace_perms, sid1,
&pol_dom) : False;
/* send a samr 0x8 command */
res2 = res ? samr_query_dom_info(
&pol_dom, switch_value, ctr) : False;
- res1 = res1 ? samr_close(
- &sam_pol) : False;
+ res1 = res1 ? samr_close( &sam_pol) : False;
- res = res ? samr_close(
- &pol_dom) : False;
+ res = res ? samr_close( &pol_dom) : False;
if (res2)
{
@@ -735,7 +732,8 @@ SAM Domains query.
uint32 msrpc_sam_enum_domains( const char* srv_name,
struct acct_info **sam,
uint32 *num_sam_entries,
- DOMAIN_FN(dom_fn))
+ DOMAIN_FN(dom_fn),
+ DOMAIN_INFO_FN(dom_inf_fn))
{
BOOL res = True;
uint32 ace_perms = 0x02000000; /* access control permissions. */
@@ -778,20 +776,22 @@ uint32 msrpc_sam_enum_domains( const char* srv_name,
dom_fn(domain_name);
}
-#if 0
if (dom_inf_fn != NULL)
{
- query_domaininfo(&sam_pol,
- domain_name,
- dom_inf_fn);
- }
- if (dom_mem_fn != NULL)
- {
- req_domainmem_info(&sam_pol,
- domain_name,
- dom_mem_fn);
+ uint32 switch_value = 2;
+ SAM_UNK_CTR ctr;
+ DOM_SID dom_sid;
+ /* connect to the domain */
+ if (samr_query_lookup_domain( &sam_pol,
+ domain_name,
+ &dom_sid) &&
+ sam_query_dominfo(srv_name, &dom_sid,
+ switch_value, &ctr))
+ {
+ dom_inf_fn(domain_name, &dom_sid,
+ switch_value, &ctr);
+ }
}
-#endif
}
}