svn commit: samba r5527 - branches/SAMBA_3_0/source/client trunk/source/client

gd at samba.org gd at samba.org
Thu Feb 24 00:11:47 GMT 2005


Author: gd
Date: 2005-02-24 00:11:42 +0000 (Thu, 24 Feb 2005)
New Revision: 5527

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

Log:
Allow own netbios name to be set in smbclient's session setup.

Guenther

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


Changeset:
Modified: branches/SAMBA_3_0/source/client/client.c
===================================================================
--- branches/SAMBA_3_0/source/client/client.c	2005-02-23 23:41:15 UTC (rev 5526)
+++ branches/SAMBA_3_0/source/client/client.c	2005-02-24 00:11:42 UTC (rev 5527)
@@ -37,6 +37,7 @@
 static pstring desthost;
 static pstring username;
 static pstring password;
+static pstring calling_name;
 static BOOL use_kerberos;
 static BOOL got_pass;
 static BOOL grepable=False;
@@ -137,7 +138,7 @@
 	
 	zero_ip(&ip);
 
-	make_nmb_name(&calling, global_myname(), 0x0);
+	make_nmb_name(&calling, calling_name, 0x0);
 	make_nmb_name(&called , server, name_type);
 
  again:
@@ -3454,7 +3455,7 @@
 	fstring server_name;
 	char name_type_hex[10];
 
-	make_nmb_name(&calling, global_myname(), 0x0);
+	make_nmb_name(&calling, calling_name, 0x0);
 	make_nmb_name(&called , desthost, name_type);
 
 	fstrcpy(server_name, desthost);
@@ -3538,6 +3539,7 @@
 	   not it was set by a command line option */
 	   
 	set_global_myworkgroup( "" );
+	set_global_myname( "" );
 
         /* set default debug level to 0 regardless of what smb.conf sets */
 	setup_logging( "smbclient", True );
@@ -3632,6 +3634,7 @@
 	   everything)?  */
 	
 	fstrcpy( new_workgroup, lp_workgroup() );
+	pstrcpy( calling_name, global_myname() );
 	
 	if ( override_logfile )
 		setup_logging( lp_logfile(), False );
@@ -3646,6 +3649,9 @@
 	if ( strlen(new_workgroup) != 0 )
 		set_global_myworkgroup( new_workgroup );
 
+	if ( strlen(calling_name) != 0 )
+		set_global_myname( calling_name );
+
 	if(poptPeekArg(pc)) {
 		pstrcpy(service,poptGetArg(pc));  
 		/* Convert any '/' characters in the service name to '\' characters */

Modified: trunk/source/client/client.c
===================================================================
--- trunk/source/client/client.c	2005-02-23 23:41:15 UTC (rev 5526)
+++ trunk/source/client/client.c	2005-02-24 00:11:42 UTC (rev 5527)
@@ -37,6 +37,7 @@
 static pstring desthost;
 static pstring username;
 static pstring password;
+static pstring calling_name;
 static BOOL use_kerberos;
 static BOOL got_pass;
 static BOOL grepable=False;
@@ -2980,7 +2981,7 @@
 	
 	zero_ip(&ip);
 
-	make_nmb_name(&calling, global_myname(), 0x0);
+	make_nmb_name(&calling, calling_name, 0x0);
 	make_nmb_name(&called , server, name_type);
 
  again:
@@ -3166,7 +3167,7 @@
 	fstring server_name;
 	char name_type_hex[10];
 
-	make_nmb_name(&calling, global_myname(), 0x0);
+	make_nmb_name(&calling, calling_name, 0x0);
 	make_nmb_name(&called , desthost, name_type);
 
 	fstrcpy(server_name, desthost);
@@ -3250,6 +3251,7 @@
 	   not it was set by a command line option */
 	   
 	set_global_myworkgroup( "" );
+	set_global_myname( "" );
 
         /* set default debug level to 0 regardless of what smb.conf sets */
 	setup_logging( "smbclient", True );
@@ -3344,6 +3346,7 @@
 	   everything)?  */
 	
 	fstrcpy( new_workgroup, lp_workgroup() );
+	pstrcpy( calling_name, global_myname() );
 	
 	if ( override_logfile )
 		setup_logging( lp_logfile(), False );
@@ -3358,6 +3361,9 @@
 	if ( strlen(new_workgroup) != 0 )
 		set_global_myworkgroup( new_workgroup );
 
+	if ( strlen(calling_name) != 0 )
+		set_global_myname( calling_name );
+
 	if(poptPeekArg(pc)) {
 		pstrcpy(service,poptGetArg(pc));  
 		/* Convert any '/' characters in the service name to '\' characters */



More information about the samba-cvs mailing list