Skip to content

Commit f4d5d4d

Browse files
committed
Fix apparmor config.
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.
1 parent 490ba2a commit f4d5d4d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

data/apparmor/usr.bin.redshift.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
audit dbus bus=system,
3737

3838
owner @{HOME}/.config/redshift/redshift.conf r,
39+
# Legacy config path
40+
owner @{HOME}/.config/redshift.conf r,
41+
42+
# Required by getpwuid() call in config-ini.c.
43+
/etc/passwd* r,
3944

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

0 commit comments

Comments
 (0)