Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP5:Update
lbreakouthd
lbreakouthd-user-hiscoredir.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File lbreakouthd-user-hiscoredir.patch of Package lbreakouthd
commit 70e5094212b112ce63399a3beda0e1cbffa0e9b3 Author: Atri Bhattacharya <badshah400@gmail.com> Date: Thu Jan 19 13:38:48 2023 +0530 Save high scores to user config dir. Previously high scores were being saved to a common (i.e. not specific to each user account) file in localstatedir, which needed to be world-writable to allow any user to save data. This patch uses the user specific config dir to store the high score file instead, thus avoiding creating global world-writable files with obvious security implications. An added benefit of doing this is that one user's hiscores will not be over-written by another's. diff --git a/src/hiscores.cpp b/src/hiscores.cpp index 3938181..110d05a 100644 --- a/src/hiscores.cpp +++ b/src/hiscores.cpp @@ -100,7 +100,7 @@ Hiscores::Hiscores() int l, s; string prefix; - fname = string(HISCOREDIR) + "/lbreakouthd.hscr"; + fname = getHomeDir() + "/" + CONFIGDIR + "/lbreakouthd.hscr"; if (!fileExists(fname)) { _loginfo("No hiscores file yet.\n"); return; /* no hiscores yet */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor