Package: release.debian.org
Severity: normal
Tags: bookworm
X-Debbugs-Cc: ebook-spea...@packages.debian.org
Control: affects -1 + src:ebook-speaker
User: release.debian....@packages.debian.org
Usertags: pu

Hello,

I have uploaded ebook-speaker_6.2.0-4+deb12u1 for inclusion in
bookworm.

[ Reason ]
As reported on
https://github.com/book-readers/ebook-speaker/issues/4
Some users see ebook-speaker just completely fail... just because their
login is longer than 8 characters. oldstable already had the issue.

[ Impact ]
Users with a login longer than 8 characters cannot use ebook-speaker.

[ Tests ]
This was tested manually.

[ Risks ]
The code is rather simple.

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
The patch gets rid of the use of the cuserid() function which brings the
length limitation. Instead we just compare gids as int rather than
interating over the logins of the group, which won't pose such kind of
issues.

Thanks,
Samuel
diff -Nru ebook-speaker-6.2.0/debian/changelog 
ebook-speaker-6.2.0/debian/changelog
--- ebook-speaker-6.2.0/debian/changelog        2022-01-08 18:01:53.000000000 
+0100
+++ ebook-speaker-6.2.0/debian/changelog        2022-02-06 01:10:26.000000000 
+0100
@@ -1,3 +1,9 @@
+ebook-speaker (6.2.0-4+deb12u1) bookworm; urgency=medium
+
+  * patches/long-logins: Fix testing belonging to the audio group.
+
+ -- Samuel Thibault <sthiba...@debian.org>  Sun, 06 Feb 2022 01:10:26 +0100
+
 ebook-speaker (6.2.0-4) unstable; urgency=medium
 
   * control: Bump Standards-Version to 4.6.0 (no change)
diff -Nru ebook-speaker-6.2.0/debian/patches/long-logins 
ebook-speaker-6.2.0/debian/patches/long-logins
--- ebook-speaker-6.2.0/debian/patches/long-logins      1970-01-01 
01:00:00.000000000 +0100
+++ ebook-speaker-6.2.0/debian/patches/long-logins      2022-02-06 
01:10:26.000000000 +0100
@@ -0,0 +1,47 @@
+commit b29f4884e9a7637e09f93f8d53973c83a69670d9
+Author: Samuel Thibault <samuel.thiba...@ens-lyon.org>
+Date:   Sun Feb 11 21:32:24 2024 +0100
+
+    Fix testing belonging to the audio group
+    
+    cuserid() is limited to L_cuserid characters, which is 9.  This means that
+    users with a longer login were never seen as belonging to the group.
+    
+    Let us just replace with using getgroups, which allows
+    - to actually check the current allowed groups,
+    - to compare gids, which don't pose length limitations.
+    
+    Fixes #4
+
+diff --git a/src/common.c b/src/common.c
+index a580153..6658c40 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -911,17 +911,18 @@ void get_list_of_sound_devices (misc_t *misc, 
audio_info_t *sound_devices)
+    char *str, *orig_language;
+    struct group *grp;
+    FILE *p;
++   int ngroups;
++
++   ngroups = getgroups (0, NULL);
++   gid_t groups[ngroups];
++   getgroups (ngroups, groups);
+ 
+    grp = getgrnam ("audio");
+-   found = 0;
+-   for (g = 0; grp->gr_mem[g]; g++)
+-   {
+-      if (strcmp (grp->gr_mem[g], cuserid (NULL)) == 0)
+-      {
+-         found = 1;
+-         break;
+-      } // if
+-   } // for
++   found = getegid () == grp->gr_gid;
++
++   for (g = 0; !found && g < ngroups; g++)
++      found = groups[g] == grp->gr_gid;
++
+    if (found == 0)
+    {
+       beep ();
diff -Nru ebook-speaker-6.2.0/debian/patches/series 
ebook-speaker-6.2.0/debian/patches/series
--- ebook-speaker-6.2.0/debian/patches/series   2021-10-23 21:25:33.000000000 
+0200
+++ ebook-speaker-6.2.0/debian/patches/series   2022-02-06 01:10:26.000000000 
+0100
@@ -2,3 +2,4 @@
 path-fix
 format
 automake
+long-logins
diff -Nru ebook-speaker-6.2.0/debian/salsa-ci.yml 
ebook-speaker-6.2.0/debian/salsa-ci.yml
--- ebook-speaker-6.2.0/debian/salsa-ci.yml     2021-09-26 11:05:02.000000000 
+0200
+++ ebook-speaker-6.2.0/debian/salsa-ci.yml     2022-02-06 01:10:26.000000000 
+0100
@@ -3,6 +3,9 @@
   - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
   - 
https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
 
+variables:
+  RELEASE: bookworm
+
 test-crossbuild-arm64:
   allow_failure: false
 

Reply via email to