summaryrefslogtreecommitdiff
path: root/src/mongo/installer
diff options
context:
space:
mode:
authorNir Bar <nir.bar@panel-sw.co.il>2020-05-28 10:41:17 +0300
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-25 19:31:56 +0000
commitc61e18a3c3e18bfa486df3c8ac5a4632a390aa3a (patch)
tree5f6d785251cbe48516f3f2fc0b6fb800a93b7241 /src/mongo/installer
parenta8a66b7b36d7b936d99808884fccc49db61d5697 (diff)
downloadmongo-c61e18a3c3e18bfa486df3c8ac5a4632a390aa3a.tar.gz
SERVER-47138 Fix mongod.cfg file size when replacing tokens in the custom action
Closes #1366 Signed-off-by: Andrew Morrow <acm@mongodb.com>
Diffstat (limited to 'src/mongo/installer')
-rw-r--r--src/mongo/installer/msi/ca/CustomAction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/installer/msi/ca/CustomAction.cpp b/src/mongo/installer/msi/ca/CustomAction.cpp
index fc98732c0e4..b5a5dd1c15c 100644
--- a/src/mongo/installer/msi/ca/CustomAction.cpp
+++ b/src/mongo/installer/msi/ca/CustomAction.cpp
@@ -332,6 +332,9 @@ extern "C" UINT __stdcall UpdateMongoYAML(MSIHANDLE hInstall) {
if (!WriteFile(hFile, str.c_str(), str.length(), &written, NULL)) {
CHECKGLE_AND_LOG("Failed to write yaml file");
}
+ if (!SetEndOfFile(hFile)) {
+ CHECKGLE_AND_LOG("Failed to truncate yaml file");
+ }
} catch (const std::exception& e) {
CHECKHR_AND_LOG(E_FAIL, "Caught C++ exception %s", e.what());
} catch (...) {