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

Bug 531596

Summary: media-video/mpv-0.7.0 - src_compile(): .../work/mpv-0.7.0/build/mpv --list-options: access violation in mkdir /root/.config
Product: Gentoo Linux Reporter: Amadeusz Sławiński <amade>
Component: Current packagesAssignee: Ben de Groot (RETIRED) <yngwin>
Status: RESOLVED FIXED    
Severity: normal CC: maksbotan, media-video, nikoli, proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 499288    
Bug Blocks:    
Attachments: emerge log

Description Amadeusz Sławiński 2014-12-03 22:07:31 UTC
23:03:51 runner ' /usr/bin/perl /var/tmp/portage/media-video/mpv-0.7.0/work/mpv-0.7.0/TOOLS/zsh.pl /var/tmp/portage/media-video/mpv-0.7.0/work/mpv-0.7.0/build/mpv > etc/_mpv '
 * ACCESS DENIED:  mkdir:        /root/.config
 * ACCESS DENIED:  mkdir:        /root/.config
 * ACCESS DENIED:  mkdir:        /root/.config
 * ACCESS DENIED:  mkdir:        /root/.config
 * ACCESS DENIED:  mkdir:        /root/.config
 * ACCESS DENIED:  mkdir:        /root/.config
Waf: Leaving directory `/var/tmp/portage/media-video/mpv-0.7.0/work/mpv-0.7.0/build'
'build' finished successfully (43.460s)
>>> Source compiled.



Reproducible: Always




Portage 2.2.14 (python 2.7.8-final-0, hardened/linux/amd64/selinux, gcc-4.9.1, glibc-2.20, 3.17.3-hardened x86_64)
=================================================================
System uname: Linux-3.17.3-hardened-x86_64-Intel-R-_Core-TM-_i3_CPU_M_350_@_2.27GHz-with-gentoo-2.2
KiB Mem:     2997020 total,   1308156 free
KiB Swap:    3145724 total,   2927760 free
Timestamp of tree: Wed, 03 Dec 2014 00:45:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p30-r1
dev-lang/perl:            5.20.1-r3
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.2
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          9999
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.9.1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.3-r2
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17-r1 (virtual/os-headers)
sys-libs/glibc:           2.20
Repositories: gentoo amade-overlay
Installed sets: @steam
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x google-chrome skype-4.0.0.7-copyright"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/amade/overlay"
SYNC=""
USE="X aac acl acpi alsa amd64 apache2 audit berkdb bzip2 caps cli cracklib crypt cups cxx dbus dri dvd ffmpeg flac gdbm gif git gnutls gold gpg hardened iconv icu ipv6 jpeg jpeg2k justify libnotify mmx mmxext mng modules mp3 multilib mysql mysqli ncurses nls nptl ogg open_perms opengl openmp pam pax_kernel pcre png qt3support readline selinux session sse sse2 sse4_1 sse4_2 ssl ssse3 svg tcpd theora threads thunar tiff udev unicode urandom usb v4l vaapi vdpau vim-syntax vorbis x264 xattr xcb xft xinerama xpm xtpax zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB pl" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 ppc ppc64" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Amadeusz Sławiński 2014-12-03 22:11:52 UTC
Created attachment 390886 [details]
emerge log
Comment 2 Nikoli 2014-12-05 18:40:12 UTC
# emerge --info mpv|grep ^FEATURES=
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"

I have userpriv and usersandbox enabled, '/root/.config' does not exist and no sandbox violations are displayed. But selinux sandbox is not enabled here.

What and why tries to create files in your /root/? You are running mpv build as portage user, default home directory for it is '/var/tmp/portage'. If you can, please help to analyze problem and find solution.
Comment 3 Amadeusz Sławiński 2014-12-05 18:55:01 UTC
# emerge --info mpv|grep "^FEATURES="
FEATURES="assume-digests binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"

# ls -l /root/.config 
total 12
drwx------. 2 root root 4096 Nov  3  2013 htop
drwx------. 2 root root 4096 Nov 15 15:32 mpv
drwx------. 2 root root 4096 Feb 11  2014 pulse
# ls -l /root/.config/mpv 
total 0
Comment 4 Nikoli 2014-12-05 19:04:21 UTC
And what is home directory of your portage user? May be something like HOME=/root/ was exported?
Comment 5 Amadeusz Sławiński 2014-12-05 19:48:35 UTC
So I looked a bit following $HOME suggestion and it seems that it emerges fine when I unset $XDG_CONFIG_HOME which was set to /root/.config
Comment 6 Nikoli 2014-12-05 19:58:53 UTC
# grep XDG_CONFIG_HOME /var/tmp/portage/media-video/mpv-9999/temp/environment 
    export XDG_CONFIG_HOME="${T}/.config";
    mkdir -p "${XDG_DATA_HOME}" "${XDG_CONFIG_HOME}" "${XDG_CACHE_HOME}" "${XDG_RUNTIME_DIR}";

So why you have XDG_CONFIG_HOME set to /root/.config for portage user?
Comment 7 Amadeusz Sławiński 2014-12-05 20:43:05 UTC
Well, I'm not sure why shell env leaks into portage.

I have x11-misc/xdg-user-dirs installed, maybe it causes something...

Seems like it happens early because waf uses it, /var/tmp/portage/media-video/mpv-0.7.0/work/mpv-0.7.0/.lock-waf_linux2_build contains "'XDG_CONFIG_HOME': '/root/.config'" pair
Comment 8 Nikoli 2014-12-05 21:36:04 UTC
I reproduced problem:
XDG_CONFIG_HOME=/root/.t123/ emerge -1v mpv
...
[242/242] Creating build/etc/_mpv
00:29:55 runner ' /usr/bin/perl /var/tmp/portage/media-video/mpv-9999/work/mpv-9999/TOOLS/zsh.pl /var/tmp/portage/media-video/mpv-9999/work/mpv-9999/build/mpv > etc/_mpv '
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
 * ACCESS DENIED:  mkdir:        /root/.t123
...
Comment 9 Coacher 2016-01-13 16:51:53 UTC
This issue was fixed upstream in

commit 638a398d628ab4bb04a040480ca09606f0b652de
Author: Philip Sequeira <phsequei@gmail.com>
Date:   Sun Mar 29 23:15:59 2015 -0400

    TOOLS/zsh.pl: use --no-config when calling mpv


The above commit is included in mpv >= v0.9.0.
Affected versions are long gone from tree now.

I can confirm it isn't reproducible with current mpv versions available in tree.
Closing.