summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer Jackson <spencer.jackson@mongodb.com>2017-07-31 12:01:31 -0400
committerSpencer Jackson <spencer.jackson@mongodb.com>2017-07-31 13:59:59 -0400
commitf305e8262eb4403e2ca1aaf7a5fa9adf9a80fdc7 (patch)
treef5f0dda58cf542929f356b47b0b52d1e0116e475
parent0a801f1e152136be8cd0d7c57fda71555042cca1 (diff)
downloadmongo-f305e8262eb4403e2ca1aaf7a5fa9adf9a80fdc7.tar.gz
SERVER-30435: Log username which failed to meet authenticationRestriction
-rw-r--r--src/mongo/db/auth/authorization_session.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp
index 976fa767f3c..42735813bb9 100644
--- a/src/mongo/db/auth/authorization_session.cpp
+++ b/src/mongo/db/auth/authorization_session.cpp
@@ -156,8 +156,8 @@ Status AuthorizationSession::addAndAuthorizeUser(OperationContext* opCtx,
Status restrictionStatus =
restrictionSet.validate(RestrictionEnvironment::get(*opCtx->getClient()));
if (!restrictionStatus.isOK()) {
- log() << "Failed to acquire user because of unmet authentication restrictions: "
- << restrictionStatus.reason();
+ log() << "Failed to acquire user '" << userName
+ << "' because of unmet authentication restrictions: " << restrictionStatus.reason();
return AuthorizationManager::authenticationFailedStatus;
}