Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351296 - =media-libs/libmtp-1.0.4: fails with sandbox violations (gnustep, java)
Summary: =media-libs/libmtp-1.0.4: fails with sandbox violations (gnustep, java)
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Kenneth Prugh (RETIRED)
URL:
Whiteboard:
Keywords:
: 351327 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-10 11:56 UTC by Sergey Ilinykh
Modified: 2011-06-24 21:40 UTC (History)
4 users (show)

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


Attachments
Patch that should fix sandbox violations libmtp-1.1.0 (and potentially earlier versions) (ac_quoting.patch,820 bytes, patch)
2011-06-24 21:39 UTC, Fabian Kislat
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Ilinykh 2011-01-10 11:56:02 UTC
checking for _FILE_OFFSET_BITS value needed for large files... no
ACCESS DENIED  mkdir:        /usr/GNUstep/Local/Tools
mkdir: cannot create directory `/usr/GNUstep/Local/Tools': Permission denied
ACCESS DENIED  mkdir:        /usr/GNUstep/Local/Tools
mkdir: cannot create directory `/usr/GNUstep/Local/Tools': Permission denied

emerge --info
Portage 2.2.0_alpha14 (default/linux/amd64/10.0/developer, gcc-4.5.2, glibc-2.12.2-r0, 2.6.36-zen2+ x86_64)
=================================================================
System uname: Linux-2.6.36-zen2+-x86_64-Intel-R-_Pentium-R-_Dual_CPU_T2390_@_1.86GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 10 Jan 2011 09:30:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.4 [enabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1, 3.1.3
dev-util/ccache:     3.1.4
dev-util/cmake:      2.8.3-r1
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.8
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.4.5, 4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
Repositories: gentoo rion sunrise mv
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe -ftree-vectorize -fgraphite-identity -maes -floop-parallelize-all -floop-interchange -floop-block -fira-loop-pressure"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe -ftree-vectorize -fgraphite-identity -maes -floop-parallelize-all -floop-interchange -floop-block -fira-loop-pressure"
DISTDIR="/usr/distfiles"
FEATURES="assume-digests binpkg-logs ccache digest distlocks fixlafiles fixpackages multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign splitdebug strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
LINGUAS="ru en"
MAKEOPTS="-j1"
PKGDIR="/usr/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/rion /var/lib/layman/sunrise /var/lib/layman/mv"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 amrnb avahi bash-completion berkdb bluetooth branding bzip2 cairo cdda cddb cdr cli consolekit cracklib crypt cups custom-optimization cxx dbus dri dts dv dvb dvd dvdr eds emboss encode exif faac faad fam ffmpeg firefox flac fuse gdu gif glitz gnome gnome-keyring gphoto2 gpm gsm gstreamer gtk h323 iconv idn ipv6 jabber java6 jingle jpeg jpeg2k lcms libnotify mad mikmod mmx mng modplug modules mozdevelop mp3 mp4 mpeg mtp mudflap multilib nautilus ncurses networkmanager nls nptl nptlonly ogg opengl openmp pam pango pch pcre pdf png policykit ppds pppd qt3support qt4 readline rtmp samba schroedinger sdl session sip snmp speex spell sse sse2 ssl ssse3 startup-notification subversion svg symlink sysfs tcpd theora threads tiff tokenizer truetype udev unicode upnp usb v4l2 vaapi vhosts vnc vorbis vpx webkit wifi x264 xcb xcomposite xml xorg xulrunner xv xvid xvmc zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="dav dav_fs authn_file auth_basic auth_digest authz_groupfile authz_host dir mime log_config" 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 ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" NETBEANS_MODULES="apisupport harness ide nb websvccommon php profiler webcommon cnd ergonomics dlight" NGINX_MODULES_HTTP="dav fastcgi flv access auth_basic autoindex charset browser empty_gif gzip map memcached rewrite userid" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa intel i965" 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" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


gnustep libs:
eix -cI gnustep
[I] gnustep-base/gnustep-base (1.20.1@26.09.2010): A library of general-purpose, non-graphical Objective C objects.
[I] gnustep-base/gnustep-gui (0.18.0@26.09.2010): Library of GUI classes written in Obj-C
[I] gnustep-base/gnustep-make (2.4.0@26.09.2010): GNUstep Makefile Package


Reproducible: Always

Steps to Reproduce:
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2011-01-10 19:37:45 UTC
OK, this is not related to GNUstep. See bug 351327. It's definately a problem in libmtp's end.
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2011-01-10 19:39:01 UTC
*** Bug 351327 has been marked as a duplicate of this bug. ***
Comment 3 Randy Short 2011-01-10 21:40:44 UTC
FEATURES="-userpriv -sandbox" emerge libmtp
Comment 4 Kenneth Prugh (RETIRED) gentoo-dev 2011-01-10 22:22:45 UTC
Hmm I can't seem to reproduce this issue locally with sandbox and friends enabled. 
Comment 5 Rene Wieben 2011-01-14 08:14:45 UTC
I had the same problem as in bug 351327 (the duplicate of this bug), and it turned out I had some cruft environment variables regarding Blackdown-java (I had it installed once, but switched to Sun-java years ago). Removing /etc/env.d/20java solved my problem. I guess it was a leftover from the old java-config. It had only Blackdown entries, nothing Sun. 
Comment 6 Trevor Bowen 2011-01-14 18:36:35 UTC
@Rene - Based on your tip, I was able to fix my problem too.  Apparently, my java config was pretty corrupted too.  Unfortunately, removing the one file did not help, even after rebooting.  Here's what I did:

# rm -rf /etc/env.d/20java

# grep -Ri blackdown /etc (to find all references to blackdown)
# (manually edited all files and removed blackdown)...
# vi /etc/java-config-2/build/jdk.conf
# vi /etc/profile.csh
# vi /etc/portage/package.license
# vi /etc/csh.env
# vi /etc/profile.env
# vi /etc/ld.so.conf

# eselect java-vm list
# (ensured that a valid vm was used for system-vm)

# cd /usr/lib/jvm/
# (manually removed all references to bogus Java VM's, which were breaking eselect java-vm list).
# unlink java-gcj
# unlink jre
# unlink jre-1.4.2
# unlink jre-gcj
# unlink java-1.4.2
# unlink java
# unlink java-1.4.2-gcj
# unlink jre-1.4.2-gcj
# unlink java-1.4.2-gcj-1.4.2.0

# rm -rf /opt/java-1.4.2-gcj-1.4.2.0 (deleted old cruft)

# mv /etc/alternatives/ /root/alternatives.bk
# (don't know what this did, but it had lots of bogus links, so I chunked it)

# reboot

Take this with a huge grain of salt.  There's no telling what havoc I have wreaked upon my system.  So, use at your own risk, but at least I can compile libmtp now!  WooHoo!  :D

Comment 7 Kenneth Prugh (RETIRED) gentoo-dev 2011-02-19 06:45:02 UTC
Please reopen if this persists in 1.0.6
Comment 8 Blu3 2011-06-17 13:02:36 UTC
still does funky stuff with other packages.

1.0.6 -> 1.10.0 fail.

[...]
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
ACCESS DENIED  mkdir:        /opt/eagle-5.9.0
mkdir: cannot create directory `/opt/eagle-5.9.0': Permission denied
ACCESS DENIED  mkdir:        /opt/eagle-5.9.0
mkdir: cannot create directory `/opt/eagle-5.9.0': Permission denied
mkdir: cannot create directory `/opt/eagle-5.9.0/bin': No such file or directory
checking for uint8_t in stdint.h... yes
checking whether byte ordering is bigendian... no
checking for le32toh in machine/endian.h... no
checking for ntohl in arpa/inet.h... yes
checking for swap32 in machine/endian.h... no
checking for bswap_32 in byteswap.h... yes
configure: creating ./config.status
config.status: creating src/libmtp.h
[...]

eagle was installed some time in the past hasn't been in a long time.  there was a leftover file in /etc/env.d.

the root bug in the libmtp ebuild is not fixed as searching through bugzilla yields a few similar results with different packages.  something in the build is still trying to do things in other directories. having a clean $ROOTPATH is just hiding the bug until another package gets unmerged and leaves something in $ROOTPATH which is coincidentally at the end.

editing /etc/profile.env and removing the eagle component from the end of ROOTPATH fixed it

adding anything to the end of ROOTPATH that is missing, causes the ebuild to fail, it's irrelevant what the actual directory is, just so long as it is at the end

ROOTPATH does not occur anywhere in the libmtp tar.gz file
Comment 9 Fabian Kislat 2011-06-24 21:39:46 UTC
Created attachment 278043 [details, diff]
Patch that should fix sandbox violations libmtp-1.1.0 (and potentially earlier versions)
Comment 10 Fabian Kislat 2011-06-24 21:40:29 UTC
I still observe the originally reported behaviour with libmtp-1.1.0

The reason for the problem is wrong quoting in lines 13697 and 13865 of the configure script, 

  test ! -d "$ac_dir" && as_dir="$ac_dir"; as_fn_mkdir_p

which will essentially create a random directory (wherever $as_dir points at the moment). I firmly believe that what the author wants to achieve is

  test ! -d "$ac_dir" && (as_dir="$ac_dir"; as_fn_mkdir_p)

It can be fixed in the autoconf input files m4/stdint.h and m4/byteorder.h as suggested in the attached patch.