File toppler-1.1.3-lock_dir.patch of Package toppler
--- highscore.cc
+++ highscore.cc
@@ -139,7 +139,7 @@
setegid(GameGroupID);
int lockfd;
- while ((lockfd = open(HISCOREDIR "/" SCOREFNAME ".lck", O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR)) == -1) {
+ while ((lockfd = open("/tmp/" SCOREFNAME ".lck", O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR)) == -1) {
dcl_wait();
scr_swap();
}
@@ -166,7 +166,7 @@
if (globalHighscore) {
setegid(GameGroupID);
- unlink(HISCOREDIR "/" SCOREFNAME ".lck");
+ unlink("/tmp/" SCOREFNAME ".lck");
setegid(UserGroupID);
}
@@ -215,7 +215,7 @@
/* 2. get write access to the directory to create the lock file
* to check this we try to chreate a file with a random name
*/
- snprintf(fname, 200, HISCOREDIR "/" SCOREFNAME "%i", rand());
+ snprintf(fname, 200, "/tmp/" SCOREFNAME "%i", rand());
setegid(GameGroupID);
f = fopen(fname, "w+");