summaryrefslogtreecommitdiff
path: root/src/mongo/util/cmdline_utils
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@mongodb.com>2014-04-17 14:52:00 -0400
committerShaun Verch <shaun.verch@mongodb.com>2014-04-17 17:00:59 -0400
commit44da20890f6af02ba766ca14991bbb072395a7ef (patch)
treef6496a2da0612fc4a8c13a1039564a5c633c947a /src/mongo/util/cmdline_utils
parentb54e00ff344823cab5133142e38ec1f100728e1c (diff)
downloadmongo-44da20890f6af02ba766ca14991bbb072395a7ef.tar.gz
SERVER-13644 Fix command line censorship
Diffstat (limited to 'src/mongo/util/cmdline_utils')
-rw-r--r--src/mongo/util/cmdline_utils/censor_cmdline.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mongo/util/cmdline_utils/censor_cmdline.cpp b/src/mongo/util/cmdline_utils/censor_cmdline.cpp
index e50b7018c99..ae51d536be4 100644
--- a/src/mongo/util/cmdline_utils/censor_cmdline.cpp
+++ b/src/mongo/util/cmdline_utils/censor_cmdline.cpp
@@ -41,9 +41,9 @@ namespace mongo {
static bool _isPasswordArgument(const char* argumentName) {
static const char* const passwordArguments[] = {
- "sslPEMKeyPassword",
- "ssl.PEMKeyPassword",
- "servicePassword",
+ "net.ssl.PEMKeyPassword",
+ "net.ssl.clusterPassword",
+ "processManagement.windowsService.servicePassword",
NULL // Last entry sentinel.
};
for (const char* const* current = passwordArguments; *current; ++current) {
@@ -54,6 +54,13 @@ namespace mongo {
}
static bool _isPasswordSwitch(const char* switchName) {
+ static const char* const passwordSwitches[] = {
+ "sslPEMKeyPassword",
+ "sslClusterPassword",
+ "servicePassword",
+ NULL // Last entry sentinel.
+ };
+
if (switchName[0] != '-')
return false;
size_t i = 1;
@@ -61,7 +68,11 @@ namespace mongo {
i = 2;
switchName += i;
- return _isPasswordArgument(switchName);
+ for (const char* const* current = passwordSwitches; *current; ++current) {
+ if (mongoutils::str::equals(switchName, *current))
+ return true;
+ }
+ return false;
}
static void _redact(char* arg) {