Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package lbreakouthd for openSUSE:Factory 
checked in at 2023-01-20 17:38:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lbreakouthd (Old)
 and      /work/SRC/openSUSE:Factory/.lbreakouthd.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lbreakouthd"

Fri Jan 20 17:38:39 2023 rev:9 rq:1059639 version:1.1.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/lbreakouthd/lbreakouthd.changes  2023-01-02 
15:02:05.961327678 +0100
+++ /work/SRC/openSUSE:Factory/.lbreakouthd.new.32243/lbreakouthd.changes       
2023-01-20 17:38:54.392596339 +0100
@@ -1,0 +2,12 @@
+Thu Jan 19 07:06:57 UTC 2023 - Atri Bhattacharya <badshah...@gmail.com>
+
+- Add lbreakouthd-user-hiscoredir.patch: Save hiscores to user
+  config dir instead of global localstatedir; patch sent upstream
+  [https://sourceforge.net/p/lgames/bugs/93/]. This also fixes an
+  issue with openSUSE's pkg where the installed hiscores file was
+  forced to be have '0664' perms instead of '0666', causing high
+  scores to not be saved at all.
+- Drop hiscores.hscr file installed to _localstatedir, as it is no
+  longer used in light of above patch.
+
+-------------------------------------------------------------------

New:
----
  lbreakouthd-user-hiscoredir.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lbreakouthd.spec ++++++
--- /var/tmp/diff_new_pack.b6AOtC/_old  2023-01-20 17:38:54.988599636 +0100
+++ /var/tmp/diff_new_pack.b6AOtC/_new  2023-01-20 17:38:54.992599658 +0100
@@ -26,6 +26,8 @@
 URL:            http://lgames.sourceforge.net/LBreakoutHD/
 Source:         
https://downloads.sourceforge.net/project/lgames/%{name}/%{name}-%{version}.tar.gz
 Source1:        
https://sourceforge.net/projects/lgames/files/add-ons/lbreakout2/lbreakout2-levelsets-20160512.tar.gz
+# PATCH-FIX-UPSTREAM lbreakouthd-user-hiscoredir.patch badshah...@gmail.com -- 
Save hiscores to user config dir instead of global localstatedir
+Patch0:         lbreakouthd-user-hiscoredir.patch
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++
 BuildRequires:  pkgconfig
@@ -43,7 +45,7 @@
 and must destroy bricks at the top by bouncing balls against them.
 
 %prep
-%setup -q
+%autosetup -p1
 
 %build
 %configure \
@@ -57,6 +59,9 @@
 ## install levels
 tar -xf %{SOURCE1} -C %{buildroot}%{_datadir}/%{name}/levels
 
+# Remove global hiscores files, not needed after Patch0
+rm %{buildroot}%{_localstatedir}/games/*
+
 %find_lang %{name}
 %fdupes -s %{buildroot}/%{_datadir}
 
@@ -67,7 +72,5 @@
 %{_bindir}/lbreakouthd
 %{_datadir}/%{name}
 %{_datadir}/applications/%{name}.desktop
-%dir %{_localstatedir}/games/
-%attr(664,games,games) %{_localstatedir}/games/%{name}.hscr
 
 %changelog

++++++ lbreakouthd-user-hiscoredir.patch ++++++
commit 70e5094212b112ce63399a3beda0e1cbffa0e9b3
Author: Atri Bhattacharya <badshah...@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 */

Reply via email to