diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-22 11:16:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:53:52 -0500 |
commit | c5e11daa8bb00665efabbf7939062e7e60112ced (patch) | |
tree | be3afcd3242ae31225776f74fe97cd2b41b7be56 /source4/smb_server/smb_server.c | |
parent | 93076cb9bc56a515bbefb6d88470d6776169779a (diff) | |
download | samba-c5e11daa8bb00665efabbf7939062e7e60112ced.tar.gz samba-c5e11daa8bb00665efabbf7939062e7e60112ced.tar.bz2 samba-c5e11daa8bb00665efabbf7939062e7e60112ced.zip |
r818: added server side SMB signing to Samba4
(This used to be commit 8e5ddf5e8eb74f667897f90baa2d00f02ca5818b)
Diffstat (limited to 'source4/smb_server/smb_server.c')
-rw-r--r-- | source4/smb_server/smb_server.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index aceae08ad8..ce50df04c3 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -558,7 +558,6 @@ static void construct_reply(struct request_context *req) return; } - /* Make sure this is an SMB packet */ if (memcmp(req->in.hdr,"\377SMB",4) != 0) { DEBUG(2,("Non-SMB packet of length %d. Terminating connection\n", @@ -584,6 +583,11 @@ static void construct_reply(struct request_context *req) req->flags = CVAL(req->in.hdr, HDR_FLG); req->flags2 = SVAL(req->in.hdr, HDR_FLG2); + if (!req_signing_check_incoming(req)) { + req_reply_error(req, NT_STATUS_ACCESS_DENIED); + return; + } + switch_message(type, req); } @@ -733,7 +737,7 @@ void init_smbsession(struct event_context *ev, struct model_ops *model_ops, int mem_ctx = talloc_init("server_context"); - smb = (struct server_context *)talloc(mem_ctx, sizeof(*smb)); + smb = talloc_p(mem_ctx, struct server_context); if (!smb) return; ZERO_STRUCTP(smb); |