diff options
author | Günther Deschner <gd@samba.org> | 2008-02-07 10:39:08 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-07 10:42:51 +0100 |
commit | 5881a7f679a34253bc5bd55cc2e61c0d36790fd9 (patch) | |
tree | 559a7489dba16dca9e3ed99ab199e6e4cc1d2ed7 | |
parent | f79051fe19a6f435b1ca51904dfa084031ede49f (diff) | |
download | samba-5881a7f679a34253bc5bd55cc2e61c0d36790fd9.tar.gz samba-5881a7f679a34253bc5bd55cc2e61c0d36790fd9.tar.bz2 samba-5881a7f679a34253bc5bd55cc2e61c0d36790fd9.zip |
Use rpccli_netr_DsRGetSiteName() in rpcclient.
Guenther
(This used to be commit 609c40fdd9b4c94cdf5b25cd6ac39a2a57432e0d)
-rw-r--r-- | source3/rpcclient/cmd_netlogon.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index e1d13d3b1d..ecd033f39d 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -314,20 +314,27 @@ static WERROR cmd_netlogon_dsr_getsitename(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) { - WERROR result; - char *sitename; + WERROR werr; + NTSTATUS status; + const char *sitename = NULL; if (argc != 2) { fprintf(stderr, "Usage: %s computername\n", argv[0]); return WERR_OK; } - result = rpccli_netlogon_dsr_getsitename(cli, mem_ctx, argv[1], &sitename); + status = rpccli_netr_DsRGetSiteName(cli, mem_ctx, + argv[1], + &sitename, + &werr); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } - if (!W_ERROR_IS_OK(result)) { + if (!W_ERROR_IS_OK(werr)) { printf("rpccli_netlogon_dsr_gesitename returned %s\n", - nt_errstr(werror_to_ntstatus(result))); - return result; + nt_errstr(werror_to_ntstatus(werr))); + return werr; } printf("Computer %s is on Site: %s\n", argv[1], sitename); |