summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@10gen.com>2013-12-17 11:30:59 -0500
committerShaun Verch <shaun.verch@10gen.com>2013-12-17 12:19:25 -0500
commit0e883bd5f3c8556847fb831b5c45b5d128c6de7a (patch)
tree785896c8a50aa4569858c206b41346b461330c48
parent77a74780a02b25a250888077e2b700409e3c50a9 (diff)
downloadmongo-0e883bd5f3c8556847fb831b5c45b5d128c6de7a.tar.gz
SERVER-12094 Do not strip false setParameter options from config file
-rw-r--r--src/mongo/db/cmdline.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/cmdline.cpp b/src/mongo/db/cmdline.cpp
index 0dea50faeef..c14cc603b56 100644
--- a/src/mongo/db/cmdline.cpp
+++ b/src/mongo/db/cmdline.cpp
@@ -151,9 +151,14 @@ namespace {
if ( s.find( "FASTSYNC" ) != string::npos )
cout << "warning \"fastsync\" should not be put in your configuration file" << endl;
- if ( s.c_str()[0] == '#' ) {
- // skipping commented line
- } else if ( s.find( "=FALSE" ) == string::npos ) {
+ // skip commented lines
+ if ( s.c_str()[0] == '#' ) {
+ // In this block, we copy the actual line into our intermediate buffer to actually be
+ // parsed later only if the string does not contain the substring "=FALSE" OR the option
+ // is a setParameter option. Note that this is done after we call boost::to_upper
+ // above.
+ } else if ( s.find( "=FALSE" ) == string::npos ||
+ s.find( "SETPARAMETER" ) == 0 ) {
ss << line << endl;
} else {
cout << "warning: remove or comment out this line by starting it with \'#\', skipping now : " << line << endl;