Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 355135 - sys-apps/coreutils-8.9 - logname opens /var/run/utmp 'rw' when linked statically.
Summary: sys-apps/coreutils-8.9 - logname opens /var/run/utmp 'rw' when linked statica...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Gentoo Linux bug wranglers
Depends on:
Reported: 2011-02-16 03:05 UTC by P Nienaber
Modified: 2011-02-21 22:58 UTC (History)
1 user (show)

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

5.12.3 build log (dev-lang:perl-5.12.3:20110216-024752.log,30.49 KB, text/plain)
2011-02-16 04:06 UTC, P Nienaber

Note You need to log in before you can comment on or make changes to this bug.
Description P Nienaber 2011-02-16 03:05:04 UTC
>>> Source configured.
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-21436.log"

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: /var/run/utmp
A: /var/run/utmp
R: /var/run/utmp
C: logname 

Reproducible: Always

Steps to Reproduce:
1. emerge -1 perl

Actual Results:  
sandbox access violation, as above.

Expected Results:  
new perl gets built.

Portage (default/linux/amd64/10.0, gcc-4.1.2, glibc-2.9_p20081201-r0, 2.6.37 x86_64)
System uname: Linux-2.6.37-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_3600+-with-gentoo-2.0.0
Timestamp of tree: Wed, 16 Feb 2011 02:00:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p48
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python:     2.4.4::<unknown repository>, 2.5.2-r8, 2.6.5-r3, 3.1.3
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.2
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.3.0-r1
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6::<unknown repository>, 1.5, 1.6.3::<unknown repository>, 1.7.9-r1, 1.8.5-r3::<unknown repository>, 1.9.6-r2, 1.10.2, 1.11.1
sys-devel/binutils:  2.19
sys-devel/gcc:       3.4.6-r2::<unknown repository>, 4.0.4::<unknown repository>, 4.1.2::<unknown repository>, 4.2.3, 4.3.2
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6b
sys-devel/make:      3.81
virtual/os-headers:  2.6.27-r2 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA QUAKE4 DOOM3 Q3AEULA skype-eula dlj-1.1 RTCW-ETEULA sun-bcla-java-vm RTCW AdobeFlash-10.1"
CFLAGS="-march=k8 -O3 -ftracer -pipe -fprefetch-loop-arrays"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O3 -ftracer -pipe -fprefetch-loop-arrays"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X a52 aac aim alsa amd64 bash-completion berkdb bzip2 cddb cli cracklib crypt cscope cxx daap dbus dri dts dvb dvd dvdr emacs exif fbcon ffmpeg firefox flac foomaticdb fortran gdbm gimp gimpprint gmp gpm gtk2 iconv imap javascript joystick mad matroska mmx modules mudflap multilib ncurses nptl nptlonly nvidia objc ogg oggvorbis openmp oss pam pdf perl ppds pppd python quicktime readline rtsp samba screen session skins spell sse sse2 ssl stream svg sysfs tcpd threads tiff truetype unicode v4l v4l2 vcd vorbis xine xml xmms xorg xprint xvid zlib" ALSA_CARDS="ice1724 usb-audio" 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="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" 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 ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" 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" 
Comment 1 Rafał Mużyło 2011-02-16 03:47:46 UTC
Attach full build log.
Comment 2 P Nienaber 2011-02-16 04:06:18 UTC
Created attachment 262677 [details]
5.12.3 build log
Comment 3 Wormo (RETIRED) gentoo-dev 2011-02-16 06:27:58 UTC
I find it strange that logname opened /var/tmp/utmp as writable, instead of read-only... what version of coreutils do you have installed? When I run logname from coreutils-8.7, it opens /var/tmp/utmp in read-only mode:

open("/var/run/utmp", O_RDONLY|O_CLOEXEC) = 3
Comment 4 P Nienaber 2011-02-16 08:39:42 UTC
I'm at 8.9.  For reference (in case there have been modifications to the ebuild without a -r#):

     Wed Jan  5 14:35:03 2011 >>> sys-apps/coreutils-8.9  (I most likely did a sync very shortly before that)

Should I give 8.10 a try, as that's the newest I have unmasked?
Comment 5 P Nienaber 2011-02-16 08:57:58 UTC
Reproducible with coreutils 8.10
Comment 6 Rafał Mużyło 2011-02-16 18:17:04 UTC
Any chance your old glibc matters ?
It doesn't seem logname had any updates lately.

On unrelated note: it doesn't print anyting useful for me
- it seems that for whatever reason getlogin() just fails.
Comment 7 P Nienaber 2011-02-16 21:09:11 UTC
Well, then... I figured I'd do some testing along the way.  glibc insists I first build coreutils -static (I've built it very recently so it's definitely linked against my currently-installed glibc), because apparently static coreutils somehow doesn't get along with newer versions of glibc, DESPITE THE FACT THAT IT SHOULDN'T BE LINKING AGAINST THEM.  I decided it was a good idea to test building perl after this alone, and... tada, it works!  So, this is a coreutils bug:  when built with +static, logname is broken.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-17 21:17:40 UTC
Please update the entire system first.
Comment 9 P Nienaber 2011-02-21 22:58:14 UTC
CNR with rebuild against new glibc.  Guess it was perhaps a problem with my crusty old glibc, but odd that it never happened when linked dynamically against same.  Oh well!