diff options
author | Luke Leighton <lkcl@samba.org> | 1999-11-26 23:04:19 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-11-26 23:04:19 +0000 |
commit | 9b683054751866af4fb2ac79c092392e31effaff (patch) | |
tree | e9648db6efbff69ff731c1df466f59fd21cc853e /source3/rpc_client/msrpc_samr.c | |
parent | 5e3bc7875656362770b0c9a2a45d2f83c985c6e5 (diff) | |
download | samba-9b683054751866af4fb2ac79c092392e31effaff.tar.gz samba-9b683054751866af4fb2ac79c092392e31effaff.tar.bz2 samba-9b683054751866af4fb2ac79c092392e31effaff.zip |
whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.
found out that getopt() _must_ have optind set to 0 before reuse.
still haven't decided what to do with the net* api yet...
(This used to be commit 29c480085e786905bfd92ea3cd93658f94e96e47)
Diffstat (limited to 'source3/rpc_client/msrpc_samr.c')
-rw-r--r-- | source3/rpc_client/msrpc_samr.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/source3/rpc_client/msrpc_samr.c b/source3/rpc_client/msrpc_samr.c index 8dd5201bb1..d72e57308c 100644 --- a/source3/rpc_client/msrpc_samr.c +++ b/source3/rpc_client/msrpc_samr.c @@ -1388,12 +1388,50 @@ BOOL msrpc_sam_create_dom_user(const char* srv_name, DOM_SID *sid1, if (res2) { - DEBUG(5,("cmd_sam_create_dom_user: succeeded\n")); + DEBUG(5,("msrpc_sam_create_dom_user: succeeded\n")); } else { - DEBUG(5,("cmd_sam_create_dom_user: failed\n")); + DEBUG(5,("msrpc_sam_create_dom_user: failed\n")); } return res2; } + +/**************************************************************************** +experimental SAM query display info. +****************************************************************************/ +BOOL msrpc_sam_query_dispinfo(const char* srv_name, const char* domain, + DOM_SID *sid1, + uint16 switch_value, + uint32 *num_entries, SAM_DISPINFO_CTR *ctr, + DISP_FN(disp_fn)) +{ + BOOL res = True; + BOOL res1 = True; + uint32 ace_perms = 0x304; /* absolutely no idea. */ + POLICY_HND sam_pol; + POLICY_HND pol_dom; + + /* establish a connection. */ + res = res ? samr_connect( srv_name, 0x02000000, &sam_pol) : False; + + /* connect to the domain */ + res = res ? samr_open_domain( &sam_pol, ace_perms, sid1, + &pol_dom) : False; + + /* send a samr query_disp_info command */ + res1 = res ? samr_query_dispinfo( &pol_dom, switch_value, + num_entries, ctr) : False; + + res = res ? samr_close(&sam_pol) : False; + res = res ? samr_close(&pol_dom) : False; + + if (res1 && disp_fn != NULL) + { + disp_fn(domain, sid1, switch_value, *num_entries, ctr); + } + + return res1; +} + |