Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 638882 - www-client/firefox-bin permission denied for /opt/firefox/all-gentoo.js
Summary: www-client/firefox-bin permission denied for /opt/firefox/all-gentoo.js
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-26 11:19 UTC by egon
Modified: 2017-12-06 23:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description egon 2017-11-26 11:19:34 UTC
After fresh update (from stable to stable) to www-client/firefox-bin-52.5.0
I got during the startup of the new browser following message:
"Failed to read the configuration file. Please contact your system administrator." there is onlyone button with 'ok'. After pressing it.
the browser is closed.
things I found out:

strace shows:
17556 open("/opt/firefox/all-gentoo.js", O_RDONLY) = -1 EACCES (Permission denied)

ls -latrh /opt/firefox/all-gentoo.js
-rw------- 1 root root 501 25. Nov 10:15 /opt/firefox/all-gentoo.js

grep gentoo /opt/firefox/defaults/pref/local-settings.js
pref("general.config.filename", "all-gentoo.js");

ls -la /opt/firefox/defaults/pref/local-settings.js
-rw-r--r-- 1 root root 129 25. Nov 10:15 /opt/firefox/defaults/pref/local-settings.js

After setting chmod 755 /opt/firefox/all-gentoo.js , firefox is starting
successfully.

There are some changes during the install process which caused that new behavior?
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2017-11-28 17:18:59 UTC
That's weird...  I'll look into that further for sure.  FYI you should chmod 644 rather than 755 as it should not have execute permissions.b
Comment 2 Ian Stakenvicius (RETIRED) gentoo-dev 2017-11-29 17:20:46 UTC
OK so i've looked into this a little and I have no idea why that file ended up with the permissions that it did on your system.  The ebuild has a simple 'cp' which should use the standard umask and give you 0644 permissions.  I am going to change that to use newins rather than cp, but it shouldn't make a difference regardless.

I've also re-emerged this package multiple times and have confirmed that all-gentoo.js is installed with 0644 permissions.

If I had to guess, I would say that you experienced this issue because you must have changed your default umask and that it is somehow affecting the emerge.
Comment 3 Larry the Git Cow gentoo-dev 2017-11-29 17:44:41 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0e2a6d201308923905c1f221f6cb855a4ba258d

commit d0e2a6d201308923905c1f221f6cb855a4ba258d
Author:     Ian Stakenvicius <axs@gentoo.org>
AuthorDate: 2017-11-29 17:38:48 +0000
Commit:     Ian Stakenvicius <axs@gentoo.org>
CommitDate: 2017-11-29 17:44:31 +0000

    www-client/firefox-bin: install all-gentoo.js using newins
    
    It may be possible for the cp that was previously used to
    stage all-gentoo.js into /opt/firefox/ to befall permissions
    issues due to a custom umask or whatnot.  Using newins should
    keep that from occurring, plus its cleaner and more ebuild-ish
    
    Bug: http://bugs.gentoo.org/638882
    Package-Manager: Portage-2.3.13, Repoman-2.3.3

 www-client/firefox-bin/Manifest                    | 344 ++++++++++-----------
 ...-52.5.0.ebuild => firefox-bin-52.5.0-r1.ebuild} |   5 +-
 ...-bin-57.0.ebuild => firefox-bin-57.0-r1.ebuild} |   5 +-
 3 files changed, 176 insertions(+), 178 deletions(-)}
Comment 4 egon 2017-11-30 20:36:25 UTC
Thank you for analyze this. I have changed following things:
/etc/profileprofile:
# 077 would be more secure, but 022 is generally quite realistic
umask 077

/etc/skel/.bashrc:
umask 077

used user for firefox calling:
has no .bash_logout .bash_profile 
.bashrc does not contain umask statement
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2017-12-01 14:40:41 UTC
(In reply to egon from comment #4)
> Thank you for analyze this. I have changed following things:
> /etc/profileprofile:
> # 077 would be more secure, but 022 is generally quite realistic
> umask 077
> 
> /etc/skel/.bashrc:
> umask 077
> 
> used user for firefox calling:
> has no .bash_logout .bash_profile 
> .bashrc does not contain umask statement


That would indeed do it.  I'm not sure which file would affect what happens with emerge (likely the first one) but I could see these umask changes causing issues with a number of packages.

Regardless I would like to know that the firefox and thunderbird ebuilds are not affected by a custom umask setting, so if you could re-emerge firefox-bin-52.5.0 and let me know that would be great and then we can close this bug.
Comment 6 egon 2017-12-06 22:29:23 UTC
updated to www-client/firefox-bin-52.5.0-r1 and startup is ok
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2017-12-06 23:19:32 UTC
Thanks!