From cc0cbd4fdc6e07538d67cc41ca07bad1eaebf493 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 24 Sep 2008 11:05:37 +0200 Subject: s3: libnet_join: use admin_domain in libnetjoin. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Signed-off-by: Günther Deschner Reviewed-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- source3/libnet/libnet_join.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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"); -- cgit