svn commit: samba r13394 - branches/SAMBA_3_0/source/rpcclient trunk/source/rpcclient

vlendec at samba.org vlendec at samba.org
Wed Feb 8 19:28:26 GMT 2006


Author: vlendec
Date: 2006-02-08 19:28:25 +0000 (Wed, 08 Feb 2006)
New Revision: 13394

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13394

Log:
Fix rpcclient to obey the -W parameter. Not that I *like* the smbclient
solution, but it does this particular job... :-)

Volker

Modified:
   branches/SAMBA_3_0/source/rpcclient/rpcclient.c
   trunk/source/rpcclient/rpcclient.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpcclient/rpcclient.c
===================================================================
--- branches/SAMBA_3_0/source/rpcclient/rpcclient.c	2006-02-08 15:09:09 UTC (rev 13393)
+++ branches/SAMBA_3_0/source/rpcclient/rpcclient.c	2006-02-08 19:28:25 UTC (rev 13394)
@@ -689,6 +689,7 @@
 	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 @@
 	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

Modified: trunk/source/rpcclient/rpcclient.c
===================================================================
--- trunk/source/rpcclient/rpcclient.c	2006-02-08 15:09:09 UTC (rev 13393)
+++ trunk/source/rpcclient/rpcclient.c	2006-02-08 19:28:25 UTC (rev 13394)
@@ -691,6 +691,7 @@
 	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 */
@@ -757,11 +758,22 @@
 	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



More information about the samba-cvs mailing list