summaryrefslogtreecommitdiff
path: root/source4/utils/net
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-08-20 09:48:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:13 -0500
commitc2e2921bada17aae84e6c29f48401fa467e8ed9c (patch)
tree793f2c9010335b694d74b04018bb0f32a76a3df1 /source4/utils/net
parent5a8f826653aa32512183070d27f33a98d62f10f1 (diff)
downloadsamba-c2e2921bada17aae84e6c29f48401fa467e8ed9c.tar.gz
samba-c2e2921bada17aae84e6c29f48401fa467e8ed9c.tar.bz2
samba-c2e2921bada17aae84e6c29f48401fa467e8ed9c.zip
r1949: provide functions to access the username, userdomain and userpassword
now you're prompted when cmdline_get_userpassword() is called and the password is not yet known metze (This used to be commit d14a01533c5d465ff3709c48576b798b3be807e0)
Diffstat (limited to 'source4/utils/net')
-rw-r--r--source4/utils/net/net.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c
index 89f4e77735..da64466869 100644
--- a/source4/utils/net/net.c
+++ b/source4/utils/net/net.c
@@ -156,7 +156,6 @@ static int binary_net(int argc, const char **argv)
const char **argv_new;
TALLOC_CTX *mem_ctx;
struct net_context *ctx;
- const char *domain;
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -204,12 +203,6 @@ static int binary_net(int argc, const char **argv)
return 1;
}
- if (cmdline_auth_info.domain[0]) {
- domain = cmdline_auth_info.domain;
- } else {
- domain = lp_workgroup();
- }
-
mem_ctx = talloc_init("net_context");
ctx = talloc_p(mem_ctx, struct net_context);
if (!ctx) {
@@ -219,9 +212,9 @@ static int binary_net(int argc, const char **argv)
ZERO_STRUCTP(ctx);
ctx->mem_ctx = mem_ctx;
- ctx->user.account_name = talloc_strdup(ctx->mem_ctx, cmdline_auth_info.username);
- ctx->user.domain_name = talloc_strdup(ctx->mem_ctx, domain);
- ctx->user.password = talloc_strdup(ctx->mem_ctx, cmdline_auth_info.password);
+ ctx->user.account_name = talloc_strdup(ctx->mem_ctx, cmdline_get_username());
+ ctx->user.domain_name = talloc_strdup(ctx->mem_ctx, cmdline_get_userdomain());
+ ctx->user.password = talloc_strdup(ctx->mem_ctx, cmdline_get_userpassword());
rc = net_run_function(ctx, argc_new-1, argv_new+1, net_functable, net_usage);