summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-07 10:39:08 +0100
committerGünther Deschner <gd@samba.org>2008-02-07 10:42:51 +0100
commit609c40fdd9b4c94cdf5b25cd6ac39a2a57432e0d (patch)
treebaa6be07257e0263f3f8a986eca3554642173048 /source
parenta495e0e7c1eb91dd700a7d0fe9832fd0811cb2bb (diff)
downloadsamba-609c40fdd9b4c94cdf5b25cd6ac39a2a57432e0d.tar.gz
samba-609c40fdd9b4c94cdf5b25cd6ac39a2a57432e0d.tar.xz
samba-609c40fdd9b4c94cdf5b25cd6ac39a2a57432e0d.zip
Use rpccli_netr_DsRGetSiteName() in rpcclient.
Guenther
Diffstat (limited to 'source')
-rw-r--r--source/rpcclient/cmd_netlogon.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/rpcclient/cmd_netlogon.c b/source/rpcclient/cmd_netlogon.c
index e1d13d3b1d7..ecd033f39d4 100644
--- a/source/rpcclient/cmd_netlogon.c
+++ b/source/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);