summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-08-25 17:55:33 +0000
committerGerald Carter <jerry@samba.org>2003-08-25 17:55:33 +0000
commit658ccccdde51b270ffbbc6ce238792c427bab7dc (patch)
tree52ba3906df8d828ab2a73f67ee5fb8a3dff1dfe6
parent14eb5f108e13e598bff0396c39af4a7a820c74e9 (diff)
downloadsamba-658ccccdde51b270ffbbc6ce238792c427bab7dc.tar.gz
samba-658ccccdde51b270ffbbc6ce238792c427bab7dc.tar.bz2
samba-658ccccdde51b270ffbbc6ce238792c427bab7dc.zip
fix bug #39; save the -W value and restore it after lp_load()
(This used to be commit 79efe7d72ba503b58c8ad3b9b1c711f5ebb33521)
-rw-r--r--source3/client/client.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 949933b890..67931b00b4 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2779,6 +2779,7 @@ static void remember_query_host(const char *arg,
poptContext pc;
char *p;
int rc = 0;
+ fstring new_workgroup;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -2809,6 +2810,11 @@ static void remember_query_host(const char *arg,
*query_host = 0;
*base_directory = 0;
+
+ /* initialize the workgroup name so we can determine whether or
+ not it was set by a command line option */
+
+ set_global_myworkgroup( "" );
/* set default debug level to 0 regardless of what smb.conf sets */
DEBUGLEVEL_CLASS[DBGC_ALL] = 0;
@@ -2891,13 +2897,24 @@ static void remember_query_host(const char *arg,
* set by cmdline arg or remain default (0)
*/
AllowDebugChange = False;
-
+
+ /* save the workgroup...
+
+ FIXME!! do we need to do tyhis for other options as well
+ (or maybe a generic way to keep lp_load() from overwriting
+ everything)? */
+
+ fstrcpy( new_workgroup, lp_workgroup() );
+
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);
}
load_interfaces();
+
+ if ( strlen(new_workgroup) != 0 )
+ set_global_myworkgroup( new_workgroup );
if(poptPeekArg(pc)) {
pstrcpy(service,poptGetArg(pc));