summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2020-10-13 14:27:07 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-13 23:08:09 +0000
commitbd0d70757b89507312451b9791f81b96b5e35e3d (patch)
treec867d7a184cc5f40ed119464bdf3c02f40657a66
parent9b519f5f01cfa98636b061785acdaf58a3dfcf77 (diff)
downloadmongo-bd0d70757b89507312451b9791f81b96b5e35e3d.tar.gz
SERVER-51514 ProgramRunner::launchProcess() should escape backslashes on Windows
-rw-r--r--jstests/sslSpecial/x509_cluster_auth_rollover.js2
-rw-r--r--src/mongo/shell/shell_utils_launcher.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/jstests/sslSpecial/x509_cluster_auth_rollover.js b/jstests/sslSpecial/x509_cluster_auth_rollover.js
index b9d51c1ced3..15412f7b3bb 100644
--- a/jstests/sslSpecial/x509_cluster_auth_rollover.js
+++ b/jstests/sslSpecial/x509_cluster_auth_rollover.js
@@ -34,7 +34,7 @@ rst.nodes.forEach((node) => {
// All the certificates' DNs share this base
const dnBase = "C=US, ST=New York, L=New York,";
// This is the DN of the rollover certificate.
-const rolloverDN = dnBase + " O=MongoDB\\, Inc. (Rollover), OU=Kernel (Rollover), CN=server";
+const rolloverDN = dnBase + " O=MongoDB Inc. (Rollover), OU=Kernel (Rollover), CN=server";
// This is the DN of the original certificate
const originalDN = dnBase + " O=MongoDB, OU=Kernel, CN=server";
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
index 2de721aada7..8043610f65e 100644
--- a/src/mongo/shell/shell_utils_launcher.cpp
+++ b/src/mongo/shell/shell_utils_launcher.cpp
@@ -655,9 +655,9 @@ void ProgramRunner::launchProcess(int child_stdout) {
ss << _argv[i];
else {
ss << '"';
- // escape all embedded quotes
+ // Escape all embedded quotes and backslashes.
for (size_t j = 0; j < _argv[i].size(); ++j) {
- if (_argv[i][j] == '"')
+ if (_argv[i][j] == '"' || _argv[i][j] == '\\')
ss << '\\';
ss << _argv[i][j];
}