for some calls: create, read, write, ioct and set_info
allowed_flags = SMB2_HDR_FLAG_CHAINED |
SMB2_HDR_FLAG_SIGNED |
SMB2_HDR_FLAG_DFS;
- if (opcode == SMB2_OP_CANCEL) {
+ switch (opcode) {
+ case SMB2_OP_CANCEL:
allowed_flags |= SMB2_HDR_FLAG_ASYNC;
+ break;
+ case SMB2_OP_CREATE:
+ case SMB2_OP_READ:
+ case SMB2_OP_WRITE:
+ case SMB2_OP_SETINFO:
+ case SMB2_OP_IOCTL:
+ /* TODO: any other? or valid for all? */
+ allowed_flags |= SMB2_HDR_FLAG_REPLAY_OPERATION;
+ break;
+ default:
+ break;
}
+
if ((flags & ~allowed_flags) != 0) {
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}