diff options
author | Günther Deschner <gd@samba.org> | 2008-04-04 01:40:29 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-04-04 01:40:29 +0200 |
commit | 29f44dc144c6d4dfe58fd9eb7fb673d3d702d556 (patch) | |
tree | e7c49b205440dcb772e63b10f463f0ee2c5d0bb2 /source3/rpc_client | |
parent | e7553ab79ca7e68a9c66f0ffc1f8e93dedcf12b8 (diff) | |
download | samba-29f44dc144c6d4dfe58fd9eb7fb673d3d702d556.tar.gz samba-29f44dc144c6d4dfe58fd9eb7fb673d3d702d556.tar.bz2 samba-29f44dc144c6d4dfe58fd9eb7fb673d3d702d556.zip |
Move rpccli_try_samr_connects out of rpcclient.
Guenther
(This used to be commit f550cdb6f240830ee1e3a2dfe5f4128bca0cf836)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_samr.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index f0763cce1f..fd4fbfc9f4 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -225,3 +225,47 @@ void get_query_dispinfo_params(int loop_count, uint32 *max_entries, break; } } + +NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + uint32_t access_mask, + POLICY_HND *connect_pol) +{ + NTSTATUS status; + union samr_ConnectInfo info_in, info_out; + struct samr_ConnectInfo1 info1; + uint32_t lvl_out = 0; + + ZERO_STRUCT(info1); + + info1.client_version = SAMR_CONNECT_W2K; + info_in.info1 = info1; + + status = rpccli_samr_Connect5(cli, mem_ctx, + cli->cli->srv_name_slash, + access_mask, + 1, + &info_in, + &lvl_out, + &info_out, + connect_pol); + if (NT_STATUS_IS_OK(status)) { + return status; + } + + status = rpccli_samr_Connect4(cli, mem_ctx, + cli->cli->srv_name_slash, + SAMR_CONNECT_W2K, + access_mask, + connect_pol); + if (NT_STATUS_IS_OK(status)) { + return status; + } + + status = rpccli_samr_Connect2(cli, mem_ctx, + cli->cli->srv_name_slash, + access_mask, + connect_pol); + return status; +} + |