summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2005-02-24 00:11:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:45 -0500
commit9fa9ca4f8bc712cfdbc9658f72295bd815f3dc61 (patch)
tree16d66831bc814e590fe32e61123edf6a16bca7e3 /source3
parent9150205f985265216929006bab1976bd6d2bfc24 (diff)
downloadsamba-9fa9ca4f8bc712cfdbc9658f72295bd815f3dc61.tar.gz
samba-9fa9ca4f8bc712cfdbc9658f72295bd815f3dc61.tar.bz2
samba-9fa9ca4f8bc712cfdbc9658f72295bd815f3dc61.zip
r5527: Allow own netbios name to be set in smbclient's session setup.
Guenther (This used to be commit 3660b7e64d9a17bcaa4f43c6d782b0b1d52ed6ab)
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index bd282bc735..bee980d907 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -37,6 +37,7 @@ static pstring service;
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 @@ static struct cli_state *do_connect( const char *server, const char *share,
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 @@ static int do_message_op(void)
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 @@ static int do_message_op(void)
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 @@ static int do_message_op(void)
everything)? */
fstrcpy( new_workgroup, lp_workgroup() );
+ pstrcpy( calling_name, global_myname() );
if ( override_logfile )
setup_logging( lp_logfile(), False );
@@ -3646,6 +3649,9 @@ static int do_message_op(void)
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 */