summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.cpp
diff options
context:
space:
mode:
authorauto-revert-processor <dev-prod-dag@mongodb.com>2023-04-01 07:47:57 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-01 08:29:19 +0000
commit8c71831dc234382c4df156cb73adf3b6f11e933c (patch)
treef5174e212f4de076226edb0400ea7298dd1131ed /src/mongo/db/commands.cpp
parent76282d171e00b98899067fe31185ef07885bfa78 (diff)
downloadmongo-8c71831dc234382c4df156cb73adf3b6f11e933c.tar.gz
Revert "SERVER-74487 Always include tenant in db name attributes in error messages"
This reverts commit 4aca733ab5d78dc6a7bea3fc91897bc93a8b0756.
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r--src/mongo/db/commands.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index e89bbaca23a..9c53219616c 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -568,7 +568,7 @@ void CommandHelpers::canUseTransactions(const NamespaceString& nss,
const auto dbName = nss.dbName();
uassert(ErrorCodes::OperationNotSupportedInTransaction,
- str::stream() << "Cannot run command against the '" << dbName.toStringForErrorMsg()
+ str::stream() << "Cannot run command against the '" << dbName
<< "' database in a transaction.",
dbName.db() != DatabaseName::kLocal.db());
@@ -876,11 +876,10 @@ void CommandInvocation::checkAuthorization(OperationContext* opCtx,
namespace mmb = mutablebson;
mmb::Document cmdToLog(request.body, mmb::Document::kInPlaceDisabled);
c->snipForLogging(&cmdToLog);
- auto dbName = DatabaseNameUtil::deserialize(request.getValidatedTenantId(),
- request.getDatabase());
+ auto dbname = request.getDatabase();
uasserted(ErrorCodes::Unauthorized,
- str::stream() << "not authorized on " << dbName.toStringForErrorMsg()
- << " to execute command " << redact(cmdToLog.getObject()));
+ str::stream() << "not authorized on " << dbname << " to execute command "
+ << redact(cmdToLog.getObject()));
}
}
} catch (const DBException& e) {