summaryrefslogtreecommitdiff
path: root/source3/smbd/negprot.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-07-20 10:07:47 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-07-20 10:07:47 +0000
commit17fc19fe31c949a3cf6a95460eb6b4be5a147743 (patch)
tree9133f3731fb2f2a82765cc8e9cb4478e913ba8f6 /source3/smbd/negprot.c
parentbadbae319a860c5590abeb7a947bacb47647c599 (diff)
downloadsamba-17fc19fe31c949a3cf6a95460eb6b4be5a147743.tar.gz
samba-17fc19fe31c949a3cf6a95460eb6b4be5a147743.tar.bz2
samba-17fc19fe31c949a3cf6a95460eb6b4be5a147743.zip
Update the smbd reply code a little:
I don't like the idea of muliple netprots - becouse I see potential problems with people being able to maniplate internal samba variables. This applies in particular to remote names, so don't allow muliple session requests either. Also remove a pstrcpy() from the tcon code, we really don't need it. Andrew Bartlett (This used to be commit 2afa291404cfd8dae11120e5e470c38ba067c4b2)
Diffstat (limited to 'source3/smbd/negprot.c')
-rw-r--r--source3/smbd/negprot.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 81c2427a00..abe44aac8c 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -412,8 +412,17 @@ int reply_negprot(connection_struct *conn,
char *p;
int bcc = SVAL(smb_buf(inbuf),-2);
int arch = ARCH_ALL;
+
+ static BOOL done_negprot = False;
+
START_PROFILE(SMBnegprot);
+ if (done_negprot) {
+ END_PROFILE(SMBnegprot);
+ exit_server("multiple negprot's are not permitted");
+ }
+ done_negprot = True;
+
p = smb_buf(inbuf)+1;
while (p < (smb_buf(inbuf) + bcc)) {
Index++;