diff options
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/commands/user_management_commands.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/service_entry_point_common.cpp | 13 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp index 9c42dec4997..2157df890d4 100644 --- a/src/mongo/db/commands/user_management_commands.cpp +++ b/src/mongo/db/commands/user_management_commands.cpp @@ -891,8 +891,7 @@ private: auto svcCtx = _client->getServiceContext(); auto sep = svcCtx->getServiceEntryPoint(); auto opMsgRequest = OpMsgRequest::fromDBAndBody(kAdminDB, cmdBuilder->obj()); - auto requestMessage = rpc::messageFromOpMsgRequest( - rpc::supports::kAll, rpc::supports::kOpQueryOnly, opMsgRequest); + auto requestMessage = rpc::messageFromOpMsgRequest(rpc::Protocol::kOpMsg, opMsgRequest); // Switch to our local client and create a short-lived opCtx for this transaction op. AlternativeClientRegion clientRegion(_client); diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp index 7d3d299d735..7d7320f9f25 100644 --- a/src/mongo/db/service_entry_point_common.cpp +++ b/src/mongo/db/service_entry_point_common.cpp @@ -1432,11 +1432,6 @@ void ExecCommandDatabase::_initiateCommand() { globalOpCounters.gotCommand(); } - if (!isHello() && _execContext->getMessage().operation() == dbQuery) { - warnDeprecation(*client, networkOpToString(dbQuery)); - globalOpCounters.gotQueryDeprecated(); - } - // Parse the 'maxTimeMS' command option, and use it to set a deadline for the operation on the // OperationContext. The 'maxTimeMS' option unfortunately has a different meaning for a getMore // command, where it is used to communicate the maximum time to wait for new inserts on tailable @@ -1731,7 +1726,13 @@ void curOpCommandSetup(OperationContext* opCtx, const OpMsgRequest& request) { } Future<void> parseCommand(std::shared_ptr<HandleRequest::ExecutionContext> execContext) try { - execContext->setRequest(rpc::opMsgRequestFromAnyProtocol(execContext->getMessage())); + const auto& msg = execContext->getMessage(); + auto opMsgReq = rpc::opMsgRequestFromAnyProtocol(msg); + if (msg.operation() == dbQuery) { + checkAllowedOpQueryCommand(*(execContext->getOpCtx()->getClient()), + opMsgReq.getCommandName()); + } + execContext->setRequest(opMsgReq); return Status::OK(); } catch (const DBException& ex) { // Need to set request as `makeCommandResponse` expects an empty request on failure. |