summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-07-27 03:29:40 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-07-27 03:29:40 +0000
commit1478bcd847cfe0fe8374f403f20761675d944413 (patch)
tree79775c19602bc09f3dec5a49556629946fab2991
parentabcac3d1860955507a1d1b18fbae3befe6c7f7ee (diff)
downloadsamba-1478bcd847cfe0fe8374f403f20761675d944413.tar.gz
samba-1478bcd847cfe0fe8374f403f20761675d944413.tar.bz2
samba-1478bcd847cfe0fe8374f403f20761675d944413.zip
Try again to fix up 'session request' name exchange. This time we actualy
get the names... Andrew Bartlett (This used to be commit 7c9e204f7eb15139532f2cc522ed87d0ac34d118)
-rw-r--r--source3/libsmb/nmblib.c6
-rw-r--r--source3/smbd/reply.c15
2 files changed, 7 insertions, 14 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 7e97dbf43a..6ee05f0104 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -1152,8 +1152,8 @@ static int name_interpret(char *in, fstring name)
in += 2;
out++;
}
- *out = 0;
ret = out[-1];
+ out[-1] = 0;
#ifdef NETBIOS_SCOPE
/* Handle any scope names */
@@ -1167,7 +1167,7 @@ static int name_interpret(char *in, fstring name)
in += len;
}
#endif
- pull_ascii(name, out, sizeof(fstring), sizeof(out), STR_TERMINATE);
+ pull_ascii(name, out_string, sizeof(fstring), sizeof(out_string), STR_TERMINATE);
return(ret);
}
@@ -1249,7 +1249,7 @@ static char *name_ptr(char *buf,int ofs)
}
/****************************************************************************
-extract a netbios name from a buf (into a unix string)
+extract a netbios name from a buf (into a unix string) return name type
****************************************************************************/
int name_extract(char *buf,int ofs, fstring name)
{
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 5f3d6fa10e..eaaa4e2730 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -75,23 +75,16 @@ int reply_special(char *inbuf,char *outbuf)
return(0);
}
name_extract(inbuf,4,name1);
- name_extract(inbuf,4 + name_len(inbuf + 4),name2);
+ name_type = name_extract(inbuf,4 + name_len(inbuf + 4),name2);
DEBUG(2,("netbios connect: name1=%s name2=%s\n",
name1,name2));
- name1[15] = 0;
-
- len = strlen(name2);
- if (len == 16) {
- name_type = name2[15];
- name2[15] = 0;
- }
-
set_local_machine_name(name1, True);
set_remote_machine_name(name2, True);
- DEBUG(2,("netbios connect: local=%s remote=%s\n",
- get_local_machine_name(), get_remote_machine_name() ));
+ DEBUG(2,("netbios connect: local=%s remote=%s, name type = %x\n",
+ get_local_machine_name(), get_remote_machine_name(),
+ name_type));
if (name_type == 'R') {
/* We are being asked for a pathworks session ---