summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-12-11 21:22:04 +0100
committerGünther Deschner <gd@samba.org>2007-12-12 00:58:58 +0100
commit10f1cdc7971a116a6a40483d7bebeae56ccb3d4b (patch)
treee2b3fb08bb271e3184d3558f4c76c3ae48cbe783 /source3
parent68a9bd0bf612c7a2583956e978a0080bc5b02b88 (diff)
downloadsamba-10f1cdc7971a116a6a40483d7bebeae56ccb3d4b.tar.gz
samba-10f1cdc7971a116a6a40483d7bebeae56ccb3d4b.tar.bz2
samba-10f1cdc7971a116a6a40483d7bebeae56ccb3d4b.zip
Some cleanups for "net dom join".
Guenther (This used to be commit 3f426f394f3b1454c52d92331c14f41dd1474516)
Diffstat (limited to 'source3')
-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;
}