summaryrefslogtreecommitdiff
path: root/source3/smbd/ipc.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-02-01 20:43:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:31 -0500
commitc1b9243c2892220b906df86d7b021d1bf18571b6 (patch)
tree09d09cfba9f9d9f6bb007301c0294061ff2a3477 /source3/smbd/ipc.c
parent92bbd3151d2b72ebeef8b79b86b5eab84fad3898 (diff)
downloadsamba-c1b9243c2892220b906df86d7b021d1bf18571b6.tar.gz
samba-c1b9243c2892220b906df86d7b021d1bf18571b6.tar.bz2
samba-c1b9243c2892220b906df86d7b021d1bf18571b6.zip
r5165: BUG 2295: always use get_local_machine_name() rather than digging in the gloval variable 'local_machine'
(This used to be commit 6a6e4af46a5c0a693a3dd9d558a4d1c1e5d72d95)
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r--source3/smbd/ipc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 3f21a2ac6a..e3f6521fba 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -29,8 +29,6 @@
extern int max_send;
-extern fstring local_machine;
-
#define NERR_notsupported 50
extern int smb_read_error;
@@ -382,6 +380,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int
unsigned int dscnt = SVAL(inbuf,smb_vwv11);
unsigned int dsoff = SVAL(inbuf,smb_vwv12);
unsigned int suwcnt = CVAL(inbuf,smb_vwv13);
+ fstring local_machine_name;
START_PROFILE(SMBtrans);
memset(name, '\0',sizeof(name));
@@ -543,9 +542,11 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int
* WinCE wierdness....
*/
- if (name[0] == '\\' && (StrnCaseCmp(&name[1],local_machine, strlen(local_machine)) == 0) &&
- (name[strlen(local_machine)+1] == '\\'))
- name_offset = strlen(local_machine)+1;
+ fstrcpy( local_machine_name, get_local_machine_name() );
+
+ if (name[0] == '\\' && (StrnCaseCmp(&name[1],local_machine_name, strlen(local_machine_name)) == 0) &&
+ (name[strlen(local_machine_name)+1] == '\\'))
+ name_offset = strlen(local_machine_name)+1;
if (strnequal(&name[name_offset], "\\PIPE", strlen("\\PIPE"))) {
name_offset += strlen("\\PIPE");