diff options
author | Alfredo Tupone <tupone@gentoo.org> | 2007-09-26 21:55:31 +0000 |
---|---|---|
committer | Alfredo Tupone <tupone@gentoo.org> | 2007-09-26 21:55:31 +0000 |
commit | fb268da444deb82dcec63c0ee31cb589c80ec385 (patch) | |
tree | adeb13416247ae8d103103186f8adedfc4019800 /games-strategy/glest/files | |
parent | Enforce proper permissions on existing directories (security bug 182998) (diff) | |
download | gentoo-2-fb268da444deb82dcec63c0ee31cb589c80ec385.tar.gz gentoo-2-fb268da444deb82dcec63c0ee31cb589c80ec385.tar.bz2 gentoo-2-fb268da444deb82dcec63c0ee31cb589c80ec385.zip |
Version bump to 2.0.1 Bug #191636
(Portage version: 2.1.3.9)
Diffstat (limited to 'games-strategy/glest/files')
-rw-r--r-- | games-strategy/glest/files/digest-glest-2.0.1 | 12 | ||||
-rw-r--r-- | games-strategy/glest/files/glest-2.0.1-home.patch | 86 |
2 files changed, 98 insertions, 0 deletions
diff --git a/games-strategy/glest/files/digest-glest-2.0.1 b/games-strategy/glest/files/digest-glest-2.0.1 new file mode 100644 index 000000000000..e5bff50c9f59 --- /dev/null +++ b/games-strategy/glest/files/digest-glest-2.0.1 @@ -0,0 +1,12 @@ +MD5 f929ec9135b43305fa870b2cc274a1e7 deutsch_2.0.1.zip 1903 +RMD160 50d53e084e1cd1f66656f82a19e35544901112a8 deutsch_2.0.1.zip 1903 +SHA256 776a4586d6556916467aef5f6a2623152fcc28f3ad069a45fdfa2c03de0f922f deutsch_2.0.1.zip 1903 +MD5 0ca333baa78328f97c30a22063ea19fc glest_data_2.0.1.zip 64587572 +RMD160 091da0051b640263d0600e9996cc801320de27a8 glest_data_2.0.1.zip 64587572 +SHA256 612ab01a862bb29e6b491f40f0f345c85db229962637ba1832b7f35f50001ef6 glest_data_2.0.1.zip 64587572 +MD5 2d35a5d08331957f63240cadc9766b75 glest_source_2.0.1.zip 510653 +RMD160 d1b4c983cf1cd5adc151ac6917b98ef00fbb7a66 glest_source_2.0.1.zip 510653 +SHA256 f476665f374537def35ebd7737b7fa8940ef9f014cfabd5fbbd50a4c647b42b2 glest_source_2.0.1.zip 510653 +MD5 d735cd5c66a994501cb52a457bd1ff9d magyar_2.0.1.zip 2012 +RMD160 4688dd98d15ba7e072d5bf56f30d7b5e10f5c415 magyar_2.0.1.zip 2012 +SHA256 580a4fd6144ca528c167d6b5668e97cdcd3b00aa6e8d22695fe5012794b6bf0d magyar_2.0.1.zip 2012 diff --git a/games-strategy/glest/files/glest-2.0.1-home.patch b/games-strategy/glest/files/glest-2.0.1-home.patch new file mode 100644 index 000000000000..8690e47576e4 --- /dev/null +++ b/games-strategy/glest/files/glest-2.0.1-home.patch @@ -0,0 +1,86 @@ +--- source/glest_game/main/main.cpp ++++ source/glest_game/main/main.cpp +@@ -13,6 +13,7 @@ + + #include <string> + #include <cstdlib> ++#include <sys/stat.h> + + #include "game.h" + #include "main_menu.h" +@@ -129,6 +130,17 @@ + ExceptionHandler exceptionHandler; + exceptionHandler.install(); + ++ if (!getenv("HOME")) ++ throw runtime_error("HOME not set!"); ++ ++ char str[PATH_MAX]; ++ snprintf(str, PATH_MAX, "%s/.glest", getenv("HOME")); ++ mkdir(str, 0750); ++ chdir(str); ++ mkdir("screens", 0750); ++ ++ chdir("GENTOO_DATADIR"); ++ + try{ + Config &config = Config::getInstance(); + +--- source/glest_game/main/program.cpp ++++ source/glest_game/main/program.cpp +@@ -65,8 +65,11 @@ + updateCameraTimer.init(config.getInt("CameraFps"), maxTimes); + + //log start ++ char str[PATH_MAX]; ++ snprintf(str, PATH_MAX, "%s/.glest/glest.log", getenv("HOME")); ++ + Logger &logger= Logger::getInstance(); +- logger.setFile("glest.log"); ++ logger.setFile(str); + logger.clear(); + + srand(time(NULL)); +@@ -134,9 +137,10 @@ + //save screen + if(key=='T'){ + for(int i=0; i<100; ++i){ +- string path= "screens/screen" + intToStr(i) + ".tga"; ++ char path[PATH_MAX]; ++ snprintf(path, PATH_MAX, "%s/.glest/screens/screen%d.tga", getenv("HOME"), i); + +- FILE *f= fopen(path.c_str(), "rb"); ++ FILE *f= fopen(path, "rb"); + if(f==NULL){ + Renderer::getInstance().saveScreen(path); + break; + +--- source/shared_lib/sources/util/properties.cpp ++++ source/shared_lib/sources/util/properties.cpp +@@ -33,9 +33,13 @@ + + this->path= path; + +- fileStream.open(path.c_str(), ios_base::in); ++ char str[PATH_MAX]; ++ snprintf(str, PATH_MAX, "%s/.glest/%s", getenv("HOME"), path.c_str()); ++ fileStream.open(str, ios_base::in); + if(fileStream.fail()){ +- throw runtime_error("Can't open properties file: " + path); ++ fileStream.open(path.c_str(), ios_base::in); // use defaults ++ if(fileStream.fail()) ++ throw runtime_error("Can't open properties file: " + path); + } + + properties.clear(); +@@ -70,7 +74,9 @@ + void Properties::save(const string &path){ + ofstream fileStream; + +- fileStream.open(path.c_str(), ios_base::out | ios_base::trunc); ++ char str[PATH_MAX]; ++ snprintf(str, PATH_MAX, "%s/.glest/%s", getenv("HOME"), path.c_str()); ++ fileStream.open(str, ios_base::out | ios_base::trunc); + + fileStream << "; === Properties File === \n"; + fileStream << '\n'; |