summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 167f91ae16..f885106275 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -37,7 +37,6 @@ static pstring service;
static pstring desthost;
static pstring username;
static pstring password;
-static pstring workgroup;
static BOOL use_kerberos;
static BOOL got_pass;
static char *cmdstr = NULL;
@@ -2552,10 +2551,10 @@ static struct cli_state *do_connect(const char *server, const char *share)
if (!cli_session_setup(c, username,
password, strlen(password),
password, strlen(password),
- workgroup)) {
+ lp_workgroup())) {
/* if a password was not supplied then try again with a null username */
if (password[0] || !username[0] || use_kerberos ||
- !cli_session_setup(c, "", "", 0, "", 0, workgroup)) {
+ !cli_session_setup(c, "", "", 0, "", 0, lp_workgroup())) {
d_printf("session setup failed: %s\n", cli_errstr(c));
cli_shutdown(c);
return NULL;
@@ -2620,7 +2619,7 @@ static int do_host_query(char *query_host)
return 1;
browse_host(True);
- list_servers(workgroup);
+ list_servers(lp_workgroup());
cli_shutdown(cli);
@@ -2761,6 +2760,11 @@ static void remember_query_host(const char *arg,
setup_logging(argv[0],True);
+ if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
+ fprintf(stderr, "%s: Can't load %s - run testparm to debug it\n",
+ argv[0], dyn_CONFIGFILE);
+ }
+
pc = poptGetContext("smbclient", argc, (const char **) argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
poptSetOtherOptionHelp(pc, "service <password>");
@@ -2816,11 +2820,6 @@ static void remember_query_host(const char *arg,
}
}
- if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
- fprintf(stderr, "%s: Can't load %s - run testparm to debug it\n",
- argv[0], dyn_CONFIGFILE);
- }
-
poptGetArg(pc);
load_interfaces();
@@ -2856,7 +2855,6 @@ static void remember_query_host(const char *arg,
pstrcpy(username, cmdline_auth_info.username);
pstrcpy(password, cmdline_auth_info.password);
- pstrcpy(workgroup, lp_workgroup());
use_kerberos = cmdline_auth_info.use_kerberos;
got_pass = cmdline_auth_info.got_pass;