summaryrefslogtreecommitdiff
path: root/source3/libnet
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-09-24 11:05:37 +0200
committerAndreas Schneider <asn@samba.org>2013-08-05 10:30:01 +0200
commitcc0cbd4fdc6e07538d67cc41ca07bad1eaebf493 (patch)
treef55c16b4a7af8ef8dfaf20e54fb85b1c3b6c2f92 /source3/libnet
parentc11a79c5a054e862f61c97093fa2ce5e5040f111 (diff)
downloadsamba-cc0cbd4fdc6e07538d67cc41ca07bad1eaebf493.tar.gz
samba-cc0cbd4fdc6e07538d67cc41ca07bad1eaebf493.tar.bz2
samba-cc0cbd4fdc6e07538d67cc41ca07bad1eaebf493.zip
s3: libnet_join: use admin_domain in libnetjoin.
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/libnet')
-rw-r--r--source3/libnet/libnet_join.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 348fb94bc5..4582158fca 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -686,6 +686,7 @@ static bool libnet_join_joindomain_store_secrets(TALLOC_CTX *mem_ctx,
static NTSTATUS libnet_join_connect_dc_ipc(const char *dc,
const char *user,
+ const char *domain,
const char *pass,
bool use_kerberos,
struct cli_state **cli)
@@ -705,7 +706,7 @@ static NTSTATUS libnet_join_connect_dc_ipc(const char *dc,
NULL, 0,
"IPC$", "IPC",
user,
- NULL,
+ domain,
pass,
flags,
SMB_SIGNING_DEFAULT);
@@ -727,6 +728,7 @@ static NTSTATUS libnet_join_lookup_dc_rpc(TALLOC_CTX *mem_ctx,
status = libnet_join_connect_dc_ipc(r->in.dc_name,
r->in.admin_account,
+ r->in.admin_domain,
r->in.admin_password,
r->in.use_kerberos,
cli);
@@ -1345,6 +1347,7 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
status = libnet_join_connect_dc_ipc(r->in.dc_name,
r->in.admin_account,
+ r->in.admin_domain,
r->in.admin_password,
r->in.use_kerberos,
&cli);
@@ -1724,6 +1727,17 @@ static WERROR libnet_join_pre_processing(TALLOC_CTX *mem_ctx,
return WERR_SETUP_DOMAIN_CONTROLLER;
}
+ if (!r->in.admin_domain) {
+ char *admin_domain = NULL;
+ char *admin_account = NULL;
+ split_domain_user(mem_ctx,
+ r->in.admin_account,
+ &admin_domain,
+ &admin_account);
+ r->in.admin_domain = admin_domain;
+ r->in.admin_account = admin_account;
+ }
+
if (!secrets_init()) {
libnet_join_set_error_string(mem_ctx, r,
"Unable to open secrets database");
@@ -2285,6 +2299,17 @@ static WERROR libnet_unjoin_pre_processing(TALLOC_CTX *mem_ctx,
return WERR_SETUP_DOMAIN_CONTROLLER;
}
+ if (!r->in.admin_domain) {
+ char *admin_domain = NULL;
+ char *admin_account = NULL;
+ split_domain_user(mem_ctx,
+ r->in.admin_account,
+ &admin_domain,
+ &admin_account);
+ r->in.admin_domain = admin_domain;
+ r->in.admin_account = admin_account;
+ }
+
if (!secrets_init()) {
libnet_unjoin_set_error_string(mem_ctx, r,
"Unable to open secrets database");