Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 673738

Summary: PORTAGE_TMPDIR not respecting /
Product: Portage Development Reporter: cryptopsy
Component: UnclassifiedAssignee: Portage team <dev-portage>
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on: 378403    
Bug Blocks: 671498    

Description cryptopsy 2018-12-26 03:51:09 UTC
If PORTAGE_TMPDIR="/" , it will create /portage folder, but emerge --resume will not accept it the second time it is run.

emerge --resume
Calculating dependencies... done!
*** Resuming merge...
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) dev-qt/qtwebengine-5.11.3::gentoo
>>> Jobs: 0 of 1 complete, 1 running                Load avg: 1.39, 0.98, 0.88

!!! The 'portage' subdirectory of the directory referenced by the
!!! PORTAGE_TMPDIR variable appears to be a symlink. In order to avoid
!!! sandbox violations (see bug #378379), you must adjust PORTAGE_TMPDIR
!!! instead of using the symlink located at '/portage'. A suitable
!!! PORTAGE_TMPDIR setting would be '/portage'.

If PORTAGE_TMPDIR="/portage" it will create /portage/portage and not give this error.
Comment 1 Zac Medico gentoo-dev 2019-01-01 20:31:20 UTC
The message was intended to reference bug 378403.
Comment 2 Zac Medico gentoo-dev 2019-01-01 20:51:22 UTC
It's not enough to change path comparison logic in, because with PORTAGE_TMPDIR=/ the sandbox configuration actually allows unrestricted write access to all paths.
Comment 4 Larry the Git Cow gentoo-dev 2019-01-04 03:03:35 UTC
The bug has been referenced in the following commit(s):

commit be2312f4f9bf854897431440734a765f5279c7d1
Author:     Zac Medico <>
AuthorDate: 2019-01-02 23:40:57 +0000
Commit:     Zac Medico <>
CommitDate: 2019-01-03 08:24:40 +0000 sandbox write to ${PORTAGE_TMPDIR}/portage (bug 673738)
    In, grant sandbox write access directly to
    ${PORTAGE_TMPDIR}/portage, since write access to ${PORTAGE_TMPDIR}
    itself is not needed. Also, remove the _check_temp_dir symlink
    check from bug 378403, since a symlink is permissible if write
    access is granted directly to ${PORTAGE_TMPDIR}/portage.
    Signed-off-by: Zac Medico <>

 bin/                          |  4 ++--
 lib/portage/package/ebuild/ | 27 ++-------------------------
 2 files changed, 4 insertions(+), 27 deletions(-)
Comment 5 Larry the Git Cow gentoo-dev 2019-01-04 06:03:52 UTC
The bug has been referenced in the following commit(s):

commit 549e77312735f9f19863daafaef0382ab1a2157f
Author:     Zac Medico <>
AuthorDate: 2019-01-04 04:01:57 +0000
Commit:     Zac Medico <>
CommitDate: 2019-01-04 06:03:28 +0000

    sys-apps/portage: version bump to 2.3.54
     #671808 rsync: fix usersync timestamp file permission issue
     #673738 fix PORTAGE_TMPDIR=/ edge case
     #673900 validate unshare calls
    Package-Manager: Portage-2.3.54, Repoman-2.3.12
    Signed-off-by: Zac Medico <>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.54.ebuild | 270 +++++++++++++++++++++++++++++++++
 2 files changed, 271 insertions(+)
Comment 6 Zac Medico gentoo-dev 2019-04-10 04:31:39 UTC
Fixed in portage-2.3.62.