summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-04 11:38:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:29 -0500
commitf71a4941f0184f2b5177cc1e67f8164116f19c41 (patch)
tree3304c368f1c432b12ba1742732be37fb05ffe7a6
parentc870ae8b898d3bcc81ed9fd1afd505d78dea52cc (diff)
downloadsamba-f71a4941f0184f2b5177cc1e67f8164116f19c41.tar.gz
samba-f71a4941f0184f2b5177cc1e67f8164116f19c41.tar.bz2
samba-f71a4941f0184f2b5177cc1e67f8164116f19c41.zip
r3529: fixed signing support for SMBntcancel requests (no reply means seq
number rises by 1, not 2) (This used to be commit 201ff734d47cb0c335820f11e2629cb3bd18162f)
-rw-r--r--source4/smb_server/reply.c1
-rw-r--r--source4/smb_server/signing.c12
2 files changed, 11 insertions, 2 deletions
diff --git a/source4/smb_server/reply.c b/source4/smb_server/reply.c
index 615dd692a1..8fd97df44a 100644
--- a/source4/smb_server/reply.c
+++ b/source4/smb_server/reply.c
@@ -2320,6 +2320,7 @@ void reply_ntcreate_and_X(struct smbsrv_request *req)
void reply_ntcancel(struct smbsrv_request *req)
{
/* NOTE: this request does not generate a reply */
+ req_signing_no_reply(req);
ntvfs_cancel(req);
req_destroy(req);
}
diff --git a/source4/smb_server/signing.c b/source4/smb_server/signing.c
index 8a3fd10095..c397963f38 100644
--- a/source4/smb_server/signing.c
+++ b/source4/smb_server/signing.c
@@ -130,13 +130,21 @@ static void req_signing_alloc_seq_num(struct smbsrv_request *req)
{
req->seq_num = req->smb_conn->signing.next_seq_num;
- /* TODO: we need to handle one-way requests like NTcancel, which
- only increment the sequence number by 1 */
if (req->smb_conn->signing.signing_state != SMB_SIGNING_OFF) {
req->smb_conn->signing.next_seq_num += 2;
}
}
+/*
+ called for requests that do not produce a reply of their own
+*/
+void req_signing_no_reply(struct smbsrv_request *req)
+{
+ if (req->smb_conn->signing.signing_state != SMB_SIGNING_OFF) {
+ req->smb_conn->signing.next_seq_num--;
+ }
+}
+
/***********************************************************
SMB signing - Simple implementation - check a MAC sent by client
************************************************************/