summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-03 14:09:48 -0800
committerJeremy Allison <jra@samba.org>2007-12-03 14:09:48 -0800
commitfe1a12b22fd81ac01d30c0f561cacba82532cd0e (patch)
tree0bc736437311a95657046cddb719364adf292a80 /source3/utils
parent6f1b4eb8695559049ce7b5cab20b42f7762dbf2b (diff)
downloadsamba-fe1a12b22fd81ac01d30c0f561cacba82532cd0e.tar.gz
samba-fe1a12b22fd81ac01d30c0f561cacba82532cd0e.tar.bz2
samba-fe1a12b22fd81ac01d30c0f561cacba82532cd0e.zip
Remove pstring from clirap2 by completely rewriting the damn
thing :-). Now with added paranoia. Jeremy. (This used to be commit b6b5f92bc9457220df384bdb13530c393d294ce7)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 0f58c05c51..e4b1872203 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -5603,6 +5603,7 @@ static int rpc_trustdom_establish(int argc, const char **argv)
char* domain_name_pol;
char* acct_name;
fstring pdc_name;
+ char *dc_name;
/*
* Connect to \\server\ipc$ as 'our domain' account with password
@@ -5655,7 +5656,7 @@ static int rpc_trustdom_establish(int argc, const char **argv)
*/
nt_status = connect_to_ipc_anonymous(&cli, &server_ss, (char*)pdc_name);
-
+
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("Couldn't connect to domain %s controller. Error was %s.\n",
domain_name, nt_errstr(nt_status)));
@@ -5665,13 +5666,14 @@ static int rpc_trustdom_establish(int argc, const char **argv)
/*
* Use NetServerEnum2 to make sure we're talking to a proper server
*/
-
- if (!cli_get_pdc_name(cli, domain_name, (char*)pdc_name)) {
+
+ if (!cli_get_pdc_name(cli, domain_name, &dc_name)) {
DEBUG(0, ("NetServerEnum2 error: Couldn't find primary domain controller\
for domain %s\n", domain_name));
cli_shutdown(cli);
return -1;
}
+ SAFE_FREE(dc_name);
if (!(mem_ctx = talloc_init("establishing trust relationship to "
"domain %s", domain_name))) {