aboutsummaryrefslogtreecommitdiff
path: root/src/tools/connection_patcher/Program.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-11-06 21:22:50 +0100
committerShauren <shauren.trinity@gmail.com>2014-11-06 21:22:50 +0100
commitb61e4feea5b6e86fb5923d1ba772711139063110 (patch)
treeb5598aca726f54004477d5f560e074d416d5a009 /src/tools/connection_patcher/Program.cpp
parente401f9c9e24f02aaef78577aa8620f7089d95280 (diff)
Tools/Patcher
* Client patcher no longer has to be ran from administrator level command line to successfully create bnet module * Set patched bnet module as readonly to prevent wow from deleting it
Diffstat (limited to 'src/tools/connection_patcher/Program.cpp')
-rw-r--r--src/tools/connection_patcher/Program.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/connection_patcher/Program.cpp b/src/tools/connection_patcher/Program.cpp
index 9513e2da486..a613485f839 100644
--- a/src/tools/connection_patcher/Program.cpp
+++ b/src/tools/connection_patcher/Program.cpp
@@ -43,6 +43,8 @@ namespace Connection_Patcher
template<typename PATCH, typename PATTERN>
void PatchModule(boost::filesystem::path file, boost::filesystem::path path)
{
+ namespace fs = boost::filesystem;
+
std::cout << "Patching module...\n";
Patcher patcher(file);
@@ -50,13 +52,15 @@ namespace Connection_Patcher
patcher.Patch(PATCH::Password(), PATTERN::Password());
std::string const moduleName(Helper::GetFileChecksum(patcher.binary) + ".auth");
- boost::filesystem::path const modulePath
+ fs::path const modulePath
(path / std::string(&moduleName[0], 2) / std::string(&moduleName[2], 2));
- if (!boost::filesystem::exists(modulePath))
- boost::filesystem::create_directories(modulePath);
+ if (!fs::exists(modulePath))
+ fs::create_directories(modulePath);
+ fs::permissions(modulePath / moduleName, fs::add_perms | fs::others_write | fs::group_write | fs::owner_write);
patcher.Finish(modulePath / moduleName);
+ fs::permissions(modulePath / moduleName, fs::remove_perms | fs::others_write | fs::group_write | fs::owner_write);
std::cout << "Patching module finished.\n";
}