summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-05-15 17:00:31 +0200
committerGünther Deschner <gd@samba.org>2008-05-15 17:00:31 +0200
commitf255ac9775bc86ec38855ed441aca49893353ba3 (patch)
tree4295bd08ae64f3b3b1859bb8d4e676f4ebb0ec52
parent4d593cdb19ec228adbf30cc8c408521e5770167c (diff)
downloadsamba-f255ac9775bc86ec38855ed441aca49893353ba3.tar.gz
samba-f255ac9775bc86ec38855ed441aca49893353ba3.tar.bz2
samba-f255ac9775bc86ec38855ed441aca49893353ba3.zip
net: Fix net lookup dsgetdcname, no need to pull site ourselves.
Guenther (This used to be commit 954d0998c2c00140addb6ba3845e80ed91e4effc)
-rw-r--r--source3/utils/net_lookup.c14
1 files changed, 2 insertions, 12 deletions
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;
}