Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612202 - sys-apps/sandbox: renameat/symlinkat are incorrectly rejected (as used by `ln` in sys-apps/coreutils-8.27)
Summary: sys-apps/sandbox: renameat/symlinkat are incorrectly rejected (as used by `ln...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Sandbox (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
: 612240 612242 612392 616070 616678 619614 635000 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-10 13:46 UTC by Alex
Modified: 2017-12-01 19:57 UTC (History)
7 users (show)

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


Attachments
libtool_buildlog (libtool_build.log,39.63 KB, text/x-log)
2017-03-10 18:39 UTC, Andrei F.
Details
libtool (libtool.txt,10.50 KB, text/plain)
2017-03-10 18:40 UTC, Andrei F.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2017-03-10 13:46:57 UTC
make[1]: Leaving directory '/var/tmp/portage/sys-devel/libtool-2.4.6-r3/work/libtool-2.4.6'
 * ACCESS DENIED:  renameat:     /var/tmp/portage/sys-devel/libtool-2.4.6-r3/image/usr/share/libtool/build-aux/Cu93P5Di
ln: failed to create symbolic link '/var/tmp/portage/sys-devel/libtool-2.4.6-r3/image/usr/share/libtool/build-aux/config.sub': Permission denied
 * ERROR: sys-devel/libtool-2.4.6-r3::gentoo failed (install phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line 115:  Called src_install
 *   environment, line 2800:  Called die
 * The specific snippet of code:
 *           ln -sf "${EPREFIX}"/usr/share/gnuconfig/${x##*/} "${x}" || die;
 *
 * If you need support, post the output of `emerge --info '=sys-devel/libtool-2.4.6-r3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/libtool-2.4.6-r3::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/libtool-2.4.6-r3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/libtool-2.4.6-r3/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/libtool-2.4.6-r3/work/libtool-2.4.6'
 * S: '/var/tmp/portage/sys-devel/libtool-2.4.6-r3/work/libtool-2.4.6'
 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-12903.log"
 *
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: renameat
S: deny
P: /var/tmp/portage/sys-devel/libtool-2.4.6-r3/image/usr/share/libtool/build-aux/Cu93P5Di
A: /var/tmp/portage/sys-devel/libtool-2.4.6-r3/image/usr/share/libtool/build-aux/Cu93P5Di
R: /usr/share/gnuconfig/config.sub
C: ln -sf /usr/share/gnuconfig/config.sub /var/tmp/portage/sys-devel/libtool-2.4.6-r3/image/usr/share/libtool/build-aux/config.sub
Comment 1 Alex 2017-03-10 13:48:53 UTC
coreutils-8.26
~ $ sandbox
============================= Gentoo path sandbox ==============================
Detection of the support files.
Verification of the required files.
Setting up the required environment variables.
The protected environment has been started.
--------------------------------------------------------------------------------
Process being started in forked instance.
~ $ touch bash
~ $ ln -sf /bin/bash bash
~ $ rm bash
~ $ exit
Cleaning up sandbox process
============================= Gentoo path sandbox ==============================
The protected environment has been shut down.
--------------------------------------------------------------------------------


coreutils-8.27
~ $ sandbox
============================= Gentoo path sandbox ==============================
Detection of the support files.
Verification of the required files.
Setting up the required environment variables.
The protected environment has been started.
--------------------------------------------------------------------------------
Process being started in forked instance.
~ $ touch bash
~ $ ln -sf /bin/bash bash
 * ACCESS DENIED:  renameat:     /home/alex/CuoP4Oaz
ln: failed to create symbolic link 'bash': Permission denied
~ $ rm bash
~ $ exit
Cleaning up sandbox process
============================= Gentoo path sandbox ==============================
The protected environment has been shut down.
 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/tmp/sandbox-12410.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: renameat
S: deny
P: CuoP4Oaz
A: /home/alex/CuoP4Oaz
R: /bin/bash
C: ln -sf /bin/bash bash 
 * --------------------------------------------------------------------------------
Comment 2 Alex 2017-03-10 13:51:25 UTC
ln -sf is executed in src_install in libtool-2.4.6-r3.ebuild

src_install() {
        default

        local x
        while read -d $'\0' -r x ; do
                ln -sf "${EPREFIX}"/usr/share/gnuconfig/${x##*/} "${x}" || die
        done < <(find "${ED}" '(' -name config.guess -o -name config.sub ')' -print0)
}
Comment 3 SpanKY gentoo-dev 2017-03-10 18:02:53 UTC
simple repro:
$ sandbox
$ ln -sf /asdf ./foo
$ ln -sf /asdf ./foo
 * ACCESS DENIED:  symlinkat:    /usr/local/src/gentoo/sandbox/foo
ln: failed to create symbolic link './foo': Permission denied
Comment 4 Andrei F. 2017-03-10 18:39:43 UTC
Created attachment 466608 [details]
libtool_buildlog

libtool_buildlog
Comment 5 Andrei F. 2017-03-10 18:40:10 UTC
Created attachment 466622 [details]
libtool
Comment 6 Andrei F. 2017-03-10 18:40:28 UTC
I'm experiencing the same build failure. Logs attached
Comment 7 SpanKY gentoo-dev 2017-03-10 18:51:07 UTC
fix is here:
https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=4c47cfa22802fd8201586bef233d8161df4ff61b

and included in 2.10-r4 & 2.11-r5
Comment 8 Arfrever Frehtes Taifersar Arahesis 2017-03-11 21:23:11 UTC
*** Bug 612240 has been marked as a duplicate of this bug. ***
Comment 9 Arfrever Frehtes Taifersar Arahesis 2017-03-11 21:23:20 UTC
*** Bug 612242 has been marked as a duplicate of this bug. ***
Comment 10 Nathan Caldwell 2017-03-13 00:40:27 UTC
*** Bug 612392 has been marked as a duplicate of this bug. ***
Comment 11 Jonas Stein gentoo-dev 2017-05-25 15:09:56 UTC
*** Bug 619614 has been marked as a duplicate of this bug. ***
Comment 12 Dirkjan Ochtman (RETIRED) gentoo-dev 2017-06-09 11:17:09 UTC
*** Bug 616678 has been marked as a duplicate of this bug. ***
Comment 13 Brian Evans (RETIRED) gentoo-dev 2017-06-29 17:17:49 UTC
*** Bug 616070 has been marked as a duplicate of this bug. ***
Comment 14 Matthew Marchese Gentoo Infrastructure gentoo-dev 2017-06-29 17:36:51 UTC
Users who come here: this is a sandbox issue. Upgrading sandbox to version (~)2.10-r4 should be a workaround/solution.
Comment 15 Larry the Git Cow gentoo-dev 2017-10-10 16:47:34 UTC
The bug has been referenced in the following commit(s):

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

commit d151daaab1ce39f5b9bf09e0f300010d44064341
Author:     Robin H. Johnson <robbat2@gentoo.org>
AuthorDate: 2017-10-10 16:43:56 +0000
Commit:     Robin H. Johnson <robbat2@gentoo.org>
CommitDate: 2017-10-10 16:47:22 +0000

    sys-apps/coreutils: ensure sandbox supports renameat/symlinkat.
    
    Prior to sys-apps/sandbox-2.10-r4, sandbox does not correct handle the
    renameat or symlinkat calls made by newer coreutils. This causes random
    sandbox violations during package building.
    
    Package-Manager: Portage-2.3.8, Repoman-2.3.3
    Bug: https://bugs.gentoo.org/612202
    Closes: https://bugs.gentoo.org/628928
    Closes: https://bugs.gentoo.org/633902
    Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

 sys-apps/coreutils/coreutils-8.27.ebuild | 1 +
 sys-apps/coreutils/coreutils-8.28.ebuild | 1 +
 2 files changed, 2 insertions(+)}
Comment 16 Thomas Deutschmann (RETIRED) gentoo-dev 2017-12-01 19:57:26 UTC
*** Bug 635000 has been marked as a duplicate of this bug. ***