summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-09 22:44:44 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-14 08:09:15 +0200
commitf205e4cada0a2e5d1289b5a1482dd670c65b1dfd (patch)
treea0ea702e92c9946d71acb2bba88fd5ba1920de60 /source3
parentcb064f28f976dcc74993bcbb88313618d7bba741 (diff)
downloadsamba-f205e4cada0a2e5d1289b5a1482dd670c65b1dfd.tar.gz
samba-f205e4cada0a2e5d1289b5a1482dd670c65b1dfd.tar.bz2
samba-f205e4cada0a2e5d1289b5a1482dd670c65b1dfd.zip
s3:smbd: echo FLAGS2_SMB_SECURITY_SIGNATURES* and the signature field in the reply
This matches what windows is doing. metze
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/process.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index c7f0ade8ce..ab0c147007 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1674,15 +1674,21 @@ void remove_from_common_flags2(uint32 v)
static void construct_reply_common(struct smb_request *req, const char *inbuf,
char *outbuf)
{
+ uint16_t in_flags2 = SVAL(inbuf,smb_flg2);
+ uint16_t out_flags2 = common_flags2;
+
+ out_flags2 |= in_flags2 & FLAGS2_UNICODE_STRINGS;
+ out_flags2 |= in_flags2 & FLAGS2_SMB_SECURITY_SIGNATURES;
+ out_flags2 |= in_flags2 & FLAGS2_SMB_SECURITY_SIGNATURES_REQUIRED;
+
srv_set_message(outbuf,0,0,false);
SCVAL(outbuf, smb_com, req->cmd);
SIVAL(outbuf,smb_rcls,0);
SCVAL(outbuf,smb_flg, FLAG_REPLY | (CVAL(inbuf,smb_flg) & FLAG_CASELESS_PATHNAMES));
- SSVAL(outbuf,smb_flg2,
- (SVAL(inbuf,smb_flg2) & FLAGS2_UNICODE_STRINGS) |
- common_flags2);
+ SSVAL(outbuf,smb_flg2, out_flags2);
memset(outbuf+smb_pidhigh,'\0',(smb_tid-smb_pidhigh));
+ memcpy(outbuf+smb_ss_field, inbuf+smb_ss_field, 8);
SSVAL(outbuf,smb_tid,SVAL(inbuf,smb_tid));
SSVAL(outbuf,smb_pid,SVAL(inbuf,smb_pid));