Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 573060 - dev-java/icedtea-web: Sandbox violation attempting to create /home/portage/.config
Summary: dev-java/icedtea-web: Sandbox violation attempting to create /home/portage/.c...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-27 00:15 UTC by Jonathan Callen (RETIRED)
Modified: 2016-01-28 00:24 UTC (History)
0 users

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


Attachments
build.log (dev-java:icedtea-web-1.6.1:20160126-235651.log,33.52 KB, text/x-log)
2016-01-27 14:23 UTC, Jonathan Callen (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Callen (RETIRED) gentoo-dev 2016-01-27 00:15:19 UTC
During the build of dev-java/icedtea-web, something (possibly Java itself) appears to ignore Portage setting HOME to a valid temporary directory, and use the directory in /etc/passwd instead (which can not be written during the build).  A simple fix for this is to export XDG_CONFIG_HOME="${HOME}/.config" in src_prepare (or thereabouts), which is honored.  This may need to be moved to the eclass, I haven't tried building many other Java packages yet...
Comment 1 Jonathan Callen (RETIRED) gentoo-dev 2016-01-27 00:25:12 UTC
Specifically, you can call xdg_environment_reset() (from xdg-utils.eclass) to set all the related variables safely, and create the directory with the correct ownership/permissions.
Comment 2 James Le Cuirot gentoo-dev 2016-01-27 08:25:27 UTC
Please post log output that includes which version was tried because I've never seen this.
Comment 3 Jonathan Callen (RETIRED) gentoo-dev 2016-01-27 14:23:29 UTC
Created attachment 423994 [details]
build.log
Comment 4 James Le Cuirot gentoo-dev 2016-01-27 21:49:20 UTC
Finally managed to reproduce it. I was running with FEATURES="-userpriv", which I've changed now that I'm aware what the defaults are. That wasn't enough though, I also had to change portage's HOME from /var/tmp/portage to /home/portage. While I question that change, given that /var/tmp/portage is allowed by the sandbox, you do have a point.

I would have been surprised to find that Java is honouring XDG variables but it turns out it's just icedtea-web specifically so there's no need to address this in the eclass. Adding xdg_environment_reset to src_configure did the trick so thanks.
Comment 5 Jonathan Callen (RETIRED) gentoo-dev 2016-01-28 00:24:55 UTC
Just fyi, the reason that my portage user has a home directory in /home/ is because I set PORTAGE_TMPDIR=/tmp, so packages build under /tmp/portage/ and /var/tmp/portage doesn't even exist.  I also sometimes need to log in as the portage user to test changes to builds without being root, and have some config files set up in /home/portage to make that easier.