Skip to content

Commit

Permalink
Fix apparmor config.
Browse files Browse the repository at this point in the history
Related bugs:
 * https://bugzilla.suse.com/show_bug.cgi?id=1111906
 * https://bugs.debian.org/988068
 * jonls#672
 * jonls#860

src/config-ini.c still looks for $HOME/.config/redshift.conf which
fails to open because the apparmor profile doesn’t allow it.

src/config-ini.c also does this:
   struct passwd *pwd = getpwuid(getuid());
   char *home = pwd->pw_dir;

Since getpwuid doesn’t have access to /etc/passwd* it returns NULL,
causing a segmentation fault in the line thereafter.
This code is not triggered if a config is specified (e.g.
-c redshift.conf) or $HOME/.config/redshift.conf exists.
  • Loading branch information
rumpeltux committed Apr 18, 2022
1 parent 490ba2a commit f4d5d4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/apparmor/usr.bin.redshift.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
audit dbus bus=system,

owner @{HOME}/.config/redshift/redshift.conf r,
# Legacy config path
owner @{HOME}/.config/redshift.conf r,

# Required by getpwuid() call in config-ini.c.
/etc/passwd* r,

# Site-specific additions and overrides. See local/README for details.
#include <local/usr.bin.redshift>
Expand Down

0 comments on commit f4d5d4d

Please sign in to comment.