From: Günther Deschner Date: Thu, 15 May 2008 15:00:31 +0000 (+0200) Subject: net: Fix net lookup dsgetdcname, no need to pull site ourselves. X-Git-Tag: samba-3.3.0pre1~1232 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=954d0998c2c00140addb6ba3845e80ed91e4effc;p=thirdparty%2Fsamba.git net: Fix net lookup dsgetdcname, no need to pull site ourselves. Guenther --- diff --git a/source/utils/net_lookup.c b/source/utils/net_lookup.c index 7e4d85d057d..8b9ddb62bac 100644 --- a/source/utils/net_lookup.c +++ b/source/utils/net_lookup.c @@ -364,7 +364,7 @@ static int net_lookup_dsgetdcname(struct net_context *c, int argc, const char ** { NTSTATUS status; const char *domain_name = NULL; - char *site_name = NULL; + const char *site_name = NULL; uint32_t flags = 0; struct netr_DsRGetDCNameInfo *info = NULL; TALLOC_CTX *mem_ctx; @@ -391,22 +391,13 @@ static int net_lookup_dsgetdcname(struct net_context *c, int argc, const char ** } if (argc == 3) { - site_name = SMB_STRDUP(argv[2]); - if (!site_name) { - TALLOC_FREE(mem_ctx); - return -1; - } - } - - if (!site_name) { - site_name = sitename_fetch(domain_name); + site_name = argv[2]; } status = dsgetdcname(mem_ctx, NULL, domain_name, NULL, site_name, flags, &info); if (!NT_STATUS_IS_OK(status)) { d_printf("failed with: %s\n", nt_errstr(status)); - SAFE_FREE(site_name); TALLOC_FREE(mem_ctx); return -1; } @@ -415,7 +406,6 @@ static int net_lookup_dsgetdcname(struct net_context *c, int argc, const char ** printf("%s\n", s); TALLOC_FREE(s); - SAFE_FREE(site_name); TALLOC_FREE(mem_ctx); return 0; }