summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-02-08 19:28:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:09:58 -0500
commit1e68cce96dce53557a5f2edbf1539a144db377b5 (patch)
tree794f5c59d3f46c7523fb0e4373052699a7b9ea25
parentef3f2c9675194efa17cfd4b4b5393a6e0a335bdf (diff)
downloadsamba-1e68cce96dce53557a5f2edbf1539a144db377b5.tar.gz
samba-1e68cce96dce53557a5f2edbf1539a144db377b5.tar.bz2
samba-1e68cce96dce53557a5f2edbf1539a144db377b5.zip
r13394: Fix rpcclient to obey the -W parameter. Not that I *like* the smbclient
solution, but it does this particular job... :-) Volker (This used to be commit df6d67cd10c0045f3c6f73381716300221cecf18)
-rw-r--r--source3/rpcclient/rpcclient.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 5e66b18263..3f493ce2c5 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -689,6 +689,7 @@ out_free:
struct in_addr server_ip;
NTSTATUS nt_status;
static int opt_port = 0;
+ fstring new_workgroup;
/* make sure the vars that get altered (4th field) are in
a fixed location or certain compilers complain */
@@ -755,11 +756,22 @@ out_free:
if (!init_names())
return 1;
+ /* save the workgroup...
+
+ FIXME!! do we need to do this for other options as well
+ (or maybe a generic way to keep lp_load() from overwriting
+ everything)? */
+
+ fstrcpy( new_workgroup, lp_workgroup() );
+
/* Load smb.conf file */
if (!lp_load(dyn_CONFIGFILE,True,False,False,True))
fprintf(stderr, "Can't load %s\n", dyn_CONFIGFILE);
+ if ( strlen(new_workgroup) != 0 )
+ set_global_myworkgroup( new_workgroup );
+
/*
* Get password
* from stdin if necessary