summaryrefslogtreecommitdiff
path: root/src/mongo/db/system_index.cpp
diff options
context:
space:
mode:
authorNick Zolnierz <nicholas.zolnierz@mongodb.com>2017-10-17 17:41:26 -0400
committerNick Zolnierz <nicholas.zolnierz@mongodb.com>2017-10-23 16:12:40 -0400
commitec7af3523d4aa5130c56a05d76169755d9b5a611 (patch)
tree82c73c32e697eaebe00faca69ab62f573bdc283c /src/mongo/db/system_index.cpp
parent6475f004ad0db96d907e996dd24bad9a2228d3f6 (diff)
downloadmongo-ec7af3523d4aa5130c56a05d76169755d9b5a611.tar.gz
SERVER-17846: Forbid $isolated outside of update/delete user operations
Diffstat (limited to 'src/mongo/db/system_index.cpp')
-rw-r--r--src/mongo/db/system_index.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/db/system_index.cpp b/src/mongo/db/system_index.cpp
index ccc6ccab06c..9a910570f51 100644
--- a/src/mongo/db/system_index.cpp
+++ b/src/mongo/db/system_index.cpp
@@ -99,7 +99,7 @@ void generateSystemIndexForExistingCollection(OperationContext* opCtx,
const IndexSpec& spec) {
try {
auto indexSpecStatus = index_key_validate::validateIndexSpec(
- spec.toBSON(), ns, serverGlobalParams.featureCompatibility);
+ opCtx, spec.toBSON(), ns, serverGlobalParams.featureCompatibility);
BSONObj indexSpec = fassertStatusOK(40452, indexSpecStatus);
log() << "No authorization index detected on " << ns
@@ -198,16 +198,20 @@ void createSystemIndexes(OperationContext* opCtx, Collection* collection) {
if (ns == AuthorizationManager::usersCollectionNamespace) {
auto indexSpec = fassertStatusOK(
40455,
- index_key_validate::validateIndexSpec(
- v3SystemUsersIndexSpec.toBSON(), ns, serverGlobalParams.featureCompatibility));
+ index_key_validate::validateIndexSpec(opCtx,
+ v3SystemUsersIndexSpec.toBSON(),
+ ns,
+ serverGlobalParams.featureCompatibility));
fassertStatusOK(
40456, collection->getIndexCatalog()->createIndexOnEmptyCollection(opCtx, indexSpec));
} else if (ns == AuthorizationManager::rolesCollectionNamespace) {
auto indexSpec = fassertStatusOK(
40457,
- index_key_validate::validateIndexSpec(
- v3SystemRolesIndexSpec.toBSON(), ns, serverGlobalParams.featureCompatibility));
+ index_key_validate::validateIndexSpec(opCtx,
+ v3SystemRolesIndexSpec.toBSON(),
+ ns,
+ serverGlobalParams.featureCompatibility));
fassertStatusOK(
40458, collection->getIndexCatalog()->createIndexOnEmptyCollection(opCtx, indexSpec));