Skip to content

Commit

Permalink
modif: keep pipewire group unless nosound is used
Browse files Browse the repository at this point in the history
This group is apparently used on Gentoo[1].

Currently only the "audio" supplementary group is kept.

Fixes netblue30#5992.

See also commit f329386 ("Keep vglusers group unless no3d is used
(virtualgl)", 2022-01-07) / PR netblue30#4851.

[1] https://wiki.gentoo.org/wiki/PipeWire

Reported-by: @amano-kenji
  • Loading branch information
kmk3 committed Sep 20, 2023
1 parent 4b8f1d2 commit 0091caf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions RELNOTES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ firejail (0.9.73) baseline; urgency=low
* modif: Improve --version/--help & print version on startup (#5829)
* modif: improve errExit error messages (#5871)
* modif: drop deprecated 'shell' option references (#5894)
* modif: keep pipewire group unless nosound is used (#5992 #5993)
* bugfix: qutebrowser: links will not open in the existing instance (#5601
#5618)
* bugfix: fix --hostname and --hosts-file commands
Expand Down
7 changes: 6 additions & 1 deletion src/firejail/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3217,13 +3217,18 @@ int main(int argc, char **argv, char **envp) {

gid_t g;
if (!arg_nogroups || !check_can_drop_all_groups()) {
// add audio group
// add audio groups
if (!arg_nosound) {
g = get_group_id("audio");
if (g) {
sprintf(ptr, "%d %d 1\n", g, g);
ptr += strlen(ptr);
}
g = get_group_id("pipewire");
if (g) {
sprintf(ptr, "%d %d 1\n", g, g);
ptr += strlen(ptr);
}
}

// add video group
Expand Down
2 changes: 2 additions & 0 deletions src/firejail/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ static void clean_supplementary_groups(gid_t gid) {
if (!arg_nosound) {
copy_group_ifcont("audio", groups, ngroups,
new_groups, &new_ngroups, MAX_GROUPS);
copy_group_ifcont("pipewire", groups, ngroups,
new_groups, &new_ngroups, MAX_GROUPS);
}

if (!arg_novideo) {
Expand Down

0 comments on commit 0091caf

Please sign in to comment.