Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497798 - Unified EVCS_UMASK for live eclasses to handle umask of files checked to distfiles subdir
Summary: Unified EVCS_UMASK for live eclasses to handle umask of files checked to dist...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ulrich Müller
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-11 16:26 UTC by Mart Raudsepp
Modified: 2021-07-05 08:23 UTC (History)
4 users (show)

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 Mart Raudsepp gentoo-dev 2014-01-11 16:26:26 UTC
ulm suggested an EVCS_UMASK variable amongst the live eclasses, to control the umask of files checked out under distfiles. Then developers can set it appropriately in a way, that they have write permission as both portage user (while emerging) and as their normal user that is in the portage group (while working on the ebuild from CVS tree).

See also: bug 311101
Comment 1 Ulrich Müller gentoo-dev 2014-01-11 16:55:24 UTC
Example implementation is in subversion.eclass:

   # @ECLASS-VARIABLE: ESVN_UMASK
   # @DESCRIPTION:
   # By setting this to something like 002, it can make life easier for people
   # who do development as non-root (but are in the portage group), and then
   # switch over to building with FEATURES=userpriv.  Or vice-versa.  Shouldn't
   # be a security issue here as anyone who has portage group write access
   # already can screw the system over in more creative ways.
   ESVN_UMASK="${ESVN_UMASK:-${EVCS_UMASK}}"

and in the fetch function:

    if [[ -n "${ESVN_UMASK}" ]] &&  eumask_push "${ESVN_UMASK}"
    # ... fetch operations done here
    if [[ -n "${ESVN_UMASK}" ]] &&  eumask_pop

CCing maintainers of bzr, cvs, darcs, git-r3, and mercurial eclasses.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-11 17:01:55 UTC
Just to be clear, is there a point in setting this to something else than 002? If we're all in agreement over 002, I think plaing eumask_push 002 would be cleaner.

Especially that I'd expect future src_fetch() phase to handle umask. Then, git-r3 would behave differently on EAPI -- respect EVCS_UMASK in EAPI 5, and rely on portage choice of umask in EAPI 6+.
Comment 3 Ulrich Müller gentoo-dev 2014-01-11 17:37:10 UTC
(In reply to Michał Górny from comment #2)
> Just to be clear, is there a point in setting this to something else than
> 002? If we're all in agreement over 002, I think plaing eumask_push 002
> would be cleaner.

Some people have 027 as default umask, and I guess they would prefer 007.
Comment 4 Larry the Git Cow gentoo-dev 2019-09-09 08:22:11 UTC
The bug has been referenced in the following commit(s):

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

commit a3880bcae6b796a9662e7a394edb68ae9c9762c2
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2019-09-02 13:48:58 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-09-09 08:10:27 +0000

    bzr.eclass: Respect the EVCS_UMASK variable.
    
    Bug: https://bugs.gentoo.org/497798
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 eclass/bzr.eclass | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)