Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 582282 - PMS: prohibiting changes to $TMPDIR and $HOME doesn't make sense
Summary: PMS: prohibiting changes to $TMPDIR and $HOME doesn't make sense
Status: CONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 582280
  Show dependency tree
 
Reported: 2016-05-06 15:02 UTC by Michał Górny
Modified: 2016-05-07 02:59 UTC (History)
2 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-06 15:02:56 UTC
Per PMS, none of the variables set in ebuild environment can be modified by ebuilds. This doesn't really make sense for variables TMPDIR and HOME since both are standard system environment variables that can normally be freely altered.
Comment 1 Ulrich Müller gentoo-dev 2016-05-06 15:55:12 UTC
When we allow ebuilds to change these variables, we must specify their behaviour w.r.t. environment saving (for example, what will be their value in pkg_*rm after a package move?). Also, PMS guarantees that TMPDIR and HOME will point to different locations for the install and the replacement, when reinstalling a package. How will you enforce this when ebuilds are allowed to set these variables themselves?

I tend to close this as INVALID.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-06 16:12:09 UTC
We only mangle it in local scope, relatively to the original value.
Comment 3 Ulrich Müller gentoo-dev 2016-05-06 16:26:40 UTC
Can you describe what your actual usage case is? Usually HOME points to a user's home directory and there is little reason to change it.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-06 16:34:11 UTC
We override configuration multiple times, storing different variants (for different Python versions) in separate homedirs. Then we just locally override HOME to enable the appropriate version.

The alternative is to keep rewriting (or moving around) the configuration file when switching implementations but that is ugly compared to setting HOME.
Comment 5 Ulrich Müller gentoo-dev 2016-05-06 16:51:13 UTC
(In reply to Michał Górny from comment #4)
> The alternative is to keep rewriting (or moving around) the configuration
> file when switching implementations but that is ugly compared to setting
> HOME.

This doesn't sound so complicated. I'd much prefer not to make intrusive changes to the spec for a problem that can be easily solved otherwise.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2016-05-07 00:49:31 UTC
As a compromise, maybe PMS could disallow only non-local changes to values of these variables?
Then 'local -x HOME=...' and 'HOME=... some_command' could still be used.
Comment 7 Ciaran McCreesh 2016-05-07 02:59:41 UTC
Various utilities used by the package mangler might misbehave in weird ways if given different values for these variables. I seem to recall this restriction originating because of a security issue along these lines.