summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/netapi/joindomain.c16
-rw-r--r--source3/lib/netapi/netapi.h3
2 files changed, 11 insertions, 8 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index bc26c22370..8287cd046f 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -20,10 +20,6 @@
#include "includes.h"
#include "lib/netapi/joindomain.h"
-extern const char *opt_user_name;
-extern const char *opt_workgroup;
-extern const char *opt_password;
-
static WERROR NetJoinDomainLocal(TALLOC_CTX *mem_ctx,
const char *server_name,
const char *domain_name,
@@ -219,8 +215,10 @@ WERROR NetUnjoinDomain(const char *server_name,
status = cli_full_connection(&cli, NULL, server_name,
NULL, 0,
"IPC$", "IPC",
- opt_user_name, opt_workgroup,
- opt_password, 0, Undefined, NULL);
+ ctx->username,
+ ctx->workgroup,
+ ctx->password,
+ 0, Undefined, NULL);
if (!NT_STATUS_IS_OK(status)) {
werr = ntstatus_to_werror(status);
@@ -311,8 +309,10 @@ WERROR NetGetJoinInformation(const char *server_name,
status = cli_full_connection(&cli, NULL, server_name,
NULL, 0,
"IPC$", "IPC",
- opt_user_name, opt_workgroup,
- opt_password, 0, Undefined, NULL);
+ ctx->username,
+ ctx->workgroup,
+ ctx->password,
+ 0, Undefined, NULL);
if (!NT_STATUS_IS_OK(status)) {
werr = ntstatus_to_werror(status);
diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h
index 0810ecb7bc..0637570c3e 100644
--- a/source3/lib/netapi/netapi.h
+++ b/source3/lib/netapi/netapi.h
@@ -22,6 +22,9 @@
struct libnetapi_ctx {
int debuglevel;
+ char *username;
+ char *workgroup;
+ char *password;
};
WERROR libnetapi_init(struct libnetapi_ctx **ctx);