summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authorization_session.cpp
diff options
context:
space:
mode:
authorApollon Oikonomopoulos <apoikos@debian.org>2018-12-03 20:45:58 +0200
committerApollon Oikonomopoulos <apoikos@debian.org>2018-12-03 20:45:58 +0200
commit239aabeb53a8dcd45eac7d069e0cb0180b4bc412 (patch)
treec1642d9d026783a026d41a2ae3e1920fa31edb71 /src/mongo/db/auth/authorization_session.cpp
parent3896a4a134ae19f25de14727862898cee19aa2e3 (diff)
New upstream version 3.4.18upstream/3.4.18
Diffstat (limited to 'src/mongo/db/auth/authorization_session.cpp')
-rw-r--r--src/mongo/db/auth/authorization_session.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp
index a91f350e24d..c4f219c15de 100644
--- a/src/mongo/db/auth/authorization_session.cpp
+++ b/src/mongo/db/auth/authorization_session.cpp
@@ -679,7 +679,12 @@ static int buildResourceSearchList(const ResourcePattern& target,
// Some databases should not be matchable with ResourcePattern::forAnyNormalResource.
// 'local' and 'config' are used to store special system collections, which user level
// administrators should not be able to manipulate.
- if (target.ns().db() != "local" && target.ns().db() != "config") {
+ // '$setFeatureCompatibilityVersion' is a virtual database that
+ // setFeatureCompatibilityVersion performs auth checks against. When this command was
+ // first written, there was a moratorium on creating new ActionTypes. SERVER-31983
+ // introduced the ActionType after the moratorium expired.
+ if (target.ns().db() != "local" && target.ns().db() != "config" &&
+ target.ns().db() != "$setFeatureCompatibilityVersion") {
resourceSearchList[size++] = ResourcePattern::forAnyNormalResource();
}
resourceSearchList[size++] = ResourcePattern::forDatabaseName(target.ns().db());