summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-05-20 22:55:17 +0000
committerGerald Carter <jerry@samba.org>2003-05-20 22:55:17 +0000
commit1e8f725f7c8a5cd4835e3666770789c3ffe86cbb (patch)
treeb56548bf0d5c57f151d93b52582baa86fa39bf65 /source3/smbd
parentb00c2f5ac813da58e461a550b035a02bc134850b (diff)
downloadsamba-1e8f725f7c8a5cd4835e3666770789c3ffe86cbb.tar.gz
samba-1e8f725f7c8a5cd4835e3666770789c3ffe86cbb.tar.bz2
samba-1e8f725f7c8a5cd4835e3666770789c3ffe86cbb.zip
really make sure to include the version in the lanman string; tested spnego using smbclient
(This used to be commit a032c38ed473c8365e2ea752d2f332e022092173)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/sesssetup.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index fc223ecf37..8840d4e759 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -57,18 +57,18 @@ static NTSTATUS do_map_to_guest(NTSTATUS status, auth_serversupplied_info **serv
/****************************************************************************
Add the standard 'Samba' signature to the end of the session setup.
****************************************************************************/
-static void add_signature(char *outbuf)
+static int add_signature(char *outbuf)
{
- char *p;
+ char *p = outbuf;
fstring lanman;
snprintf( lanman, sizeof(lanman), "Samba %s", VERSION );
- p = smb_buf(outbuf);
p += srvstr_push(outbuf, p, "Unix", -1, STR_TERMINATE);
p += srvstr_push(outbuf, p, lanman, -1, STR_TERMINATE);
p += srvstr_push(outbuf, p, lp_workgroup(), -1, STR_TERMINATE);
- set_message_end(outbuf,p);
+
+ return PTR_DIFF(p, outbuf);
}
/****************************************************************************
@@ -91,9 +91,8 @@ static BOOL reply_sesssetup_blob(connection_struct *conn, char *outbuf,
memcpy(p, blob.data, blob.length);
p += blob.length;
- p += srvstr_push(outbuf, p, "Unix", -1, STR_TERMINATE);
- p += srvstr_push(outbuf, p, "Samba", -1, STR_TERMINATE);
- p += srvstr_push(outbuf, p, lp_workgroup(), -1, STR_TERMINATE);
+ p += add_signature( p );
+
set_message_end(outbuf,p);
return send_smb(smbd_server_fd(),outbuf);
@@ -729,7 +728,9 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,
/* it's ok - setup a reply */
set_message(outbuf,3,0,True);
if (Protocol >= PROTOCOL_NT1) {
- add_signature(outbuf);
+ char *p = smb_buf( outbuf );
+ p += add_signature( p );
+ set_message_end( outbuf, p );
/* perhaps grab OS version here?? */
}