diff options
author | Günther Deschner <gd@samba.org> | 2005-11-22 14:10:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:30 -0500 |
commit | 63addcb4d7c9c13446d91a0972fe29542a7e1bad (patch) | |
tree | 33c02eb431e34273e4f9526a90867ef9484cd61a /source3/rpc_client | |
parent | e09cc27d3b0156fd410c1e47cbbb6686819119d4 (diff) | |
download | samba-63addcb4d7c9c13446d91a0972fe29542a7e1bad.tar.gz samba-63addcb4d7c9c13446d91a0972fe29542a7e1bad.tar.bz2 samba-63addcb4d7c9c13446d91a0972fe29542a7e1bad.zip |
r11853: Add Dsr_GetSiteName (handy for experimenting with GPOs).
Guenther
(This used to be commit c54430a7b5e40d3bdf8afdc813eb722c0a3b861e)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_netlogon.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index f12f7d09fa..e3cc97cdc6 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -539,6 +539,47 @@ WERROR rpccli_netlogon_dsr_getdcname(struct rpc_pipe_client *cli, return WERR_OK; } +/* Dsr_GetSiteName */ + +WERROR rpccli_netlogon_dsr_getsitename(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *computer_name, + char **site_name) +{ + prs_struct qbuf, rbuf; + NET_Q_DSR_GETSITENAME q; + NET_R_DSR_GETSITENAME r; + + ZERO_STRUCT(q); + ZERO_STRUCT(r); + + /* Initialize input parameters */ + + init_net_q_dsr_getsitename(&q, computer_name); + + /* Marshall data and send request */ + + CLI_DO_RPC_WERR(cli, mem_ctx, PI_NETLOGON, NET_DSR_GETSITENAME, + q, r, + qbuf, rbuf, + net_io_q_dsr_getsitename, + net_io_r_dsr_getsitename, + WERR_GENERAL_FAILURE); + + if (!W_ERROR_IS_OK(r.result)) { + return r.result; + } + + if ((site_name != NULL) && + (rpcstr_pull_unistr2_talloc(mem_ctx, site_name, + &r.uni_site_name) < 1)) { + return WERR_GENERAL_FAILURE; + } + + return WERR_OK; +} + + /* Sam synchronisation */ |