From f255ac9775bc86ec38855ed441aca49893353ba3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 15 May 2008 17:00:31 +0200 Subject: net: Fix net lookup dsgetdcname, no need to pull site ourselves. Guenther (This used to be commit 954d0998c2c00140addb6ba3845e80ed91e4effc) --- source3/utils/net_lookup.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c index 7e4d85d057..8b9ddb62ba 100644 --- a/source3/utils/net_lookup.c +++ b/source3/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; } -- cgit