From 1e68cce96dce53557a5f2edbf1539a144db377b5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 8 Feb 2006 19:28:25 +0000 Subject: 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) --- source3/rpcclient/rpcclient.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3') 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 -- cgit