Bug 1111906 - Redshift unable to read config file - fopen permission denied
Redshift unable to read config file - fopen permission denied
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: X11 Applications
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Ondřej Súkup
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-15 17:01 UTC by Chris Coutinho
Modified: 2018-10-18 14:04 UTC (History)
7 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Coutinho 2018-10-15 17:01:02 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
Build Identifier: 

Installing redshift via zypper results in a broken application - redshift can't read my configuration file. It can run on it's own, but then it doesn't read my config file.

I downloaded the most-recent redshift release from github and the resulting binary isn't effected by this problem, so it seems it has something to do with how it's built on OBS.

Reproducible: Always

Steps to Reproduce:
1. Install redshift using zypper
2. Invoke redshift from the command line
3. Error
Actual Results:  
/usr/bin/redshift -c ~/.config/redshift/redshift.conf
fopen: Permission denied
Unable to load config file.
Comment 1 Ondřej Súkup 2018-10-16 16:01:52 UTC
redshift-1.12 from tumbleweed works without any problems for me.

so what about permissions on your config file?

and your what is in your config file ?
Comment 2 Ondřej Súkup 2018-10-16 16:02:50 UTC
+ strace of /usr/bin/refshift -c .config/.... will be nice
Comment 3 Dany Marcoux 2018-10-17 17:47:21 UTC
I have the same issue. Here's the output from `strace /usr/bin/redshift -c ~/.config/redshift/redshift.conf`


http://susepaste.org/41288198
Comment 4 Ondřej Súkup 2018-10-17 22:02:05 UTC
> so it seems it has something to do with how it's built on OBS.

no, this isn't even possible, rpm packages cannot touch $HOME files.


I'm not unable to reproduce without config file set to bad permissions (chmod a-r), so please check permissions of config file and path to it.

@Dany thx for strace .. it looks same as my strace with bad permissions
Comment 5 Ondřej Súkup 2018-10-17 22:17:12 UTC
ahh, maybe I have cause of problem ... apparmor
Comment 6 Ondřej Súkup 2018-10-17 22:35:01 UTC
yes, redshift-1.12 has apparmor profile allowing read-only for old path config file. 

so temporary solution is copy config to ~/.config/redshift.conf.


@chris .. so if you used Git version it works with your config in new location. As it has proper apparmor profile.
Comment 7 Ondřej Súkup 2018-10-17 22:51:38 UTC
fix in devel repo and on the way to TW
Comment 8 Swamp Workflow Management 2018-10-18 00:40:06 UTC
This is an autogenerated message for OBS integration:
This bug (1111906) was mentioned in
https://build.opensuse.org/request/show/642728 Factory / redshift
Comment 9 Chris Coutinho 2018-10-18 11:08:08 UTC
(In reply to Ondřej Súkup from comment #7)
> fix in devel repo and on the way to TW

Hi Ondrej,

Thanks for looking into this. I moved my config file into the old location, but the error is still occurring - the temporary solution doesn't seem to work.

I'll work with my github build of redshift until the new version lands in tumbleweed, and report back whether it works again or not.

For reference here is a link to my current redshift.conf file:

    https://github.com/cbcoutinho/.dotfiles/blob/0f7822a6e20e1a42a208ac35d4574f1ddc6a718b/.config/redshift/redshift.conf

And here is the output of strace:

    https://paste.opensuse.org/19082013
Comment 10 Ondřej Súkup 2018-10-18 14:04:56 UTC
(In reply to Chris Coutinho from comment #9)
> (In reply to Ondřej Súkup from comment #7)
> > fix in devel repo and on the way to TW
> 
> Hi Ondrej,
> 
> Thanks for looking into this. I moved my config file into the old location,
> but the error is still occurring - the temporary solution doesn't seem to
> work.
> 
interesting

> I'll work with my github build of redshift until the new version lands in
> tumbleweed, and report back whether it works again or not.
as I said .. live version has different apparmor profile than last stable release

> For reference here is a link to my current redshift.conf file:
> 
>    
> https://github.com/cbcoutinho/.dotfiles/blob/
> 0f7822a6e20e1a42a208ac35d4574f1ddc6a718b/.config/redshift/redshift.conf
> 
> And here is the output of strace:
> 
>     https://paste.opensuse.org/19082013
looks same as @dany's and my personal .. system simply reject acces to this file --> permissions on file or lsm like apparmor or selininux reject redshift from reading file.

+- in few days patched version with profile allowing both locations will land in  TW.

PS: you can check apparmor using `yast2 apparmor` command and then view audit log