Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 572348 - app-admin/eselect - should ignore umask when creating files in /etc/env.d/
Summary: app-admin/eselect - should ignore umask when creating files in /etc/env.d/
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2016-01-19 12:42 UTC by Thibaud CANALE
Modified: 2016-06-17 18:46 UTC (History)
0 users

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


Attachments
emerge --info (file_572348.txt,6.67 KB, text/plain)
2016-01-19 12:42 UTC, Thibaud CANALE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaud CANALE 2016-01-19 12:42:26 UTC
Created attachment 423338 [details]
emerge --info

Hello everyone,

I notice the tool "app-admin/eselect" respects the current umask when creating a file in /etc/env.d/.
Fortunately, this is not a problem, for example for the pager and editor list, because the content of the file "/etc/profile.env" is updated automatically (by env-update) after setting a modification with eselect, but there might be an occurrence where it could be a problem.
For example, if the content of /etc/env.d/python/ can't be read by limited users, there will use a default value instead of the value written in this repertory.

The problem occurs when a limited user try to see the content with 'eselect <module> list'.

Might be a duplication of bug 279662

Steps to reproduce:
1) as root, set umask 027 or umask 077,
2) if exist, remove file /etc/env.d/99pager (or 99editor),
3) do 'eselect pager set <your_choice>' (or same for editor),
4) checking permissions on file /etc/env.d/99pager (or 99editor) respects the umask,
5) as a limited user, execute 'eselect pager list', see the following message errors (same for editor):
/usr/share/eselect/libs/config.bash: line 104: /etc/env.d/99pager: Permission denied
!!! Error: Failed to source /etc/env.d/99pager.
Call stack:
    * load_config (config.bash:104)
    * read_env_value (editor-variable.bash:49)
    * do_list (editor-variable.bash:83)
    * check_do (core.bash:24)
    * do_action (core.bash:105)
    * main (eselect:179)

Reproduce: always

Thanks for support.
Comment 1 Ulrich Müller gentoo-dev 2016-01-22 09:13:09 UTC
Right, we should do umask +rx. The question is if we should set this globally, or in config.bash, or per module.
Comment 2 Ulrich Müller gentoo-dev 2016-01-27 19:39:44 UTC
https://gitweb.gentoo.org/proj/eselect.git/commit/?id=366064aa7478a3f8bee31d37e8b1076649264455

Not sure when there will be a new release.
Comment 3 Ulrich Müller gentoo-dev 2016-06-17 18:46:24 UTC
Fixed in eselect-1.4.6.
Thank you for reporting.