From bea0240cbba0af22d82facffdc454afc441fe6d0 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 5 Nov 2017 19:11:27 +0100 Subject: [PATCH] Fixed: Escape password and login to prevent errors with special characters (such as | or &) --HG-- branch : develop --- code/ryzom/client/src/login_patch.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index d2620af9c..a7b4fa43f 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -897,9 +897,9 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool contentPrefix += "set STARTUPPATH=%~4\n"; contentPrefix += toString("set UPGRADE_FILE=%%ROOTPATH%%\\%s\n", UpgradeBatchFilename.c_str()); contentPrefix += "\n"; - contentPrefix += "set LOGIN=%5\n"; - contentPrefix += "set PASSWORD=%6\n"; - contentPrefix += "set SHARDID=%7\n"; + contentPrefix += "set LOGIN=%~5\n"; + contentPrefix += "set PASSWORD=%~6\n"; + contentPrefix += "set SHARDID=%~7\n"; #else contentPrefix += "#!/bin/sh\n"; contentPrefix += "export RYZOM_CLIENT=\"$1\"\n"; @@ -908,9 +908,9 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool contentPrefix += "export STARTUPPATH=\"$4\"\n"; contentPrefix += toString("export UPGRADE_FILE=$ROOTPATH/%s\n", UpgradeBatchFilename.c_str()); contentPrefix += "\n"; - contentPrefix += "LOGIN=$5\n"; - contentPrefix += "PASSWORD=$6\n"; - contentPrefix += "SHARDID=$7\n"; + contentPrefix += "LOGIN=\"$5\"\n"; + contentPrefix += "PASSWORD=\"$6\"\n"; + contentPrefix += "SHARDID=\"$7\"\n"; #endif contentPrefix += "\n"; @@ -932,7 +932,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool if (wantRyzomRestart) { // client shouldn't be in memory anymore else it couldn't be overwritten - contentSuffix += toString("start \"\" /D \"%%STARTUPPATH%%\" \"%%RYZOM_CLIENT%%\" %s %%LOGIN%% %%PASSWORD%% %%SHARDID%%\n", additionalParams.c_str()); + contentSuffix += toString("start \"\" /D \"%%STARTUPPATH%%\" \"%%RYZOM_CLIENT%%\" %s \"%%LOGIN%%\ \"%%PASSWORD%%\" \"%%SHARDID%%\"\n", additionalParams.c_str()); } #else if (wantRyzomRestart) @@ -955,9 +955,9 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool // launch new client #ifdef NL_OS_MAC // use exec command under OS X - contentSuffix += toString("exec \"$RYZOM_CLIENT\" %s $LOGIN $PASSWORD $SHARDID\n", additionalParams.c_str()); + contentSuffix += toString("exec \"$RYZOM_CLIENT\" %s \"$LOGIN\" \"$PASSWORD\" \"$SHARDID\"\n", additionalParams.c_str()); #else - contentSuffix += toString("\"$RYZOM_CLIENT\" %s $LOGIN $PASSWORD $SHARDID &\n", additionalParams.c_str()); + contentSuffix += toString("\"$RYZOM_CLIENT\" %s \"$LOGIN\" \"$PASSWORD\" \"$SHARDID\" &\n", additionalParams.c_str()); #endif } #endif