Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 629358 - dev-util/quilt-0.65 causes sandbox violation when rootfs is in git
Summary: dev-util/quilt-0.65 causes sandbox violation when rootfs is in git
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Mike Pagano
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-30 08:33 UTC by Martin Jansa
Modified: 2018-01-16 17:54 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 Martin Jansa 2017-08-30 08:33:12 UTC
quilt Makefile contains:
GIT_DESC :=     $(shell ./git-desc | sed -e 's:^v::')

OE @ //tmp/tmpfs/portage/dev-util/quilt-0.65/work/quilt-0.65 # cat git-desc 
#! /bin/sh

if git rev-parse --show-cdup > /dev/null 2> /dev/null; then
        tag=$(git describe --tags HEAD 2> /dev/null || \
              git rev-parse --short HEAD)
        dirty=$(git update-index --refresh --unmerged > /dev/null
                if git diff-index --name-only HEAD | read dummy; then
                    echo -dirty
                fi)
        echo $tag$dirty
fi

In my case where whole rootfs is in git (don't ask why) the rev-parse doesn't fail:
OE @ //tmp/tmpfs/portage/dev-util/quilt-0.65/work/quilt-0.65 # git rev-parse --show-cdup
../../../../../../../
so the code gets executed and the git update-index triggers the sandbox violation:


# cat /var/log/sandbox/sandbox-14359.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: open_wr
S: deny
P: /.git/index.lock
A: /.git/index.lock
R: /.git/index.lock
C: git update-index --refresh --unmerged

As a work around I'm removing git-desc file.

Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2017-08-30 16:04:53 UTC
My 2 cents: Having a git repository in / is a stupid idea, and not something we should work around in ebuilds.

You can work around the issue locally by adding SANDBOX_PREDICT="/.git" to /etc/sandbox.conf.
Comment 2 Mike Pagano gentoo-dev 2018-01-16 17:54:38 UTC
Not a recommended configuration and workaround proposed.