summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_dom.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c
index dc6bfb0561..fd386c95a8 100644
--- a/source3/utils/net_dom.c
+++ b/source3/utils/net_dom.c
@@ -59,7 +59,9 @@ static int net_dom_unjoin(int argc, const char **argv)
return net_dom_usage(argc, argv);
}
- server_name = opt_host;
+ if (opt_host) {
+ server_name = opt_host;
+ }
for (i=0; i<argc; i++) {
if (strnequal(argv[i], "account", strlen("account"))) {
@@ -142,7 +144,9 @@ static int net_dom_join(int argc, const char **argv)
return net_dom_usage(argc, argv);
}
- server_name = opt_host;
+ if (opt_host) {
+ server_name = opt_host;
+ }
if (opt_force) {
join_flags |= WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED;
@@ -191,8 +195,9 @@ static int net_dom_join(int argc, const char **argv)
werr = NetJoinDomain(server_name, domain_name, account_ou,
Account, password, join_flags);
if (!W_ERROR_IS_OK(werr)) {
- printf("Failed to join domain: %s\n",
- get_friendly_nt_error_msg(werror_to_ntstatus(werr)));
+ printf("Failed to join domain: %s (WERROR: %s)\n",
+ get_friendly_nt_error_msg(werror_to_ntstatus(werr)),
+ dos_errstr(werr));
goto done;
}