smb2_server: optimize SMB2_OP_KEEPALIVE (SMB2 Echo)
[gd/samba-autobuild/.git] / source3 / smbd / smb2_server.c
index 39d0e80f5915069154dfcd350b336214158bdd55..d768c0b0f8437756adae33e94def596373c8949f 100644 (file)
@@ -135,7 +135,6 @@ static const struct smbd_smb2_dispatch_table {
                .as_root = true,
        },{
                .opcode = SMB2_OP_KEEPALIVE,
-               .as_root = true,
        },{
                .opcode = SMB2_OP_QUERY_DIRECTORY,
                .need_session = true,
@@ -3415,7 +3414,7 @@ skipped_signing:
                SMB_ASSERT(call->fileid_ofs == 0);
                /* This call needs to be run as root */
                change_to_root_user();
-       } else {
+       } else if (opcode != SMB2_OP_KEEPALIVE) {
                SMB_ASSERT(call->need_tcon);
        }