From 4d2d5a3c66af111700191d384a6afac0fc759928 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Jul 2021 16:37:42 +0200 Subject: [PATCH] s3:smbd: remove dead code from smbd_smb2_request_dispatch() We have '} else if (signing_required || (flags & SMB2_HDR_FLAG_SIGNED)) {' before... Use 'git show -U52' to see the whole story... Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison (cherry picked from commit f8f4a9faf099eb768eaa25f1e1a7d126b75291d0) BUG: https://bugzilla.samba.org/show_bug.cgi?id=14788 --- source3/smbd/smb2_server.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 1322cf3ba08..f071c1a5ff9 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -2717,9 +2717,6 @@ static void smb2srv_update_crypto_flags(struct smbd_smb2_request *req, /* Unencrypted packet, can be signed */ if (req->do_signing) { sign_flag = SMBXSRV_PROCESSED_SIGNED_PACKET; - } else if (opcode == SMB2_OP_CANCEL) { - /* Cancel requests are allowed to skip signing */ - sign_flag &= ~SMBXSRV_PROCESSED_UNSIGNED_PACKET; } } @@ -3080,8 +3077,6 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req) if (!NT_STATUS_IS_OK(session_status)) { return smbd_smb2_request_error(req, session_status); } - } else if (opcode == SMB2_OP_CANCEL) { - /* Cancel requests are allowed to skip the signing */ } else if (opcode == SMB2_OP_IOCTL) { /* * Some special IOCTL calls don't require @@ -3118,13 +3113,6 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req) call = &_root_ioctl_call; break; } - } else if (signing_required) { - /* - * If signing is required we try to sign - * a possible error response - */ - req->do_signing = true; - return smbd_smb2_request_error(req, NT_STATUS_ACCESS_DENIED); } if (flags & SMB2_HDR_FLAG_CHAINED) {