summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/parameters.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/parameters.cpp')
-rw-r--r--src/mongo/db/commands/parameters.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp
index 997b910de8c..574f47e91bb 100644
--- a/src/mongo/db/commands/parameters.cpp
+++ b/src/mongo/db/commands/parameters.cpp
@@ -240,7 +240,7 @@ public:
const ServerParameter::Map& m = ServerParameterSet::getNodeParameterSet()->getMap();
for (ServerParameter::Map::const_iterator i = m.begin(); i != m.end(); ++i) {
- if (all || cmdObj.hasElement(i->first.c_str())) {
+ if (i->second->isEnabled() && (all || cmdObj.hasElement(i->first.c_str()))) {
if (options.getShowDetails()) {
BSONObjBuilder detailBob(result.subobjStart(i->second->name()));
i->second->append(opCtx, &detailBob, "value", boost::none);
@@ -322,6 +322,12 @@ public:
<< "], use help:true to see options ",
foundParameter != parameterMap.end());
+ // Is the parameter disabled?
+ uassert(ErrorCodes::InvalidOptions,
+ str::stream() << "Server parameter: '" << foundParameter->second->name()
+ << "' is disabled",
+ foundParameter->second->isEnabled());
+
// Make sure we are allowed to change this parameter
uassert(ErrorCodes::IllegalOperation,
str::stream() << "not allowed to change [" << parameterName << "] at runtime",