Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 404003 - app-misc/pax-utils-0.3.0: scanelf doesn't rstrip / from argument, "breaks" QA_PRESTRIPPED
Summary: app-misc/pax-utils-0.3.0: scanelf doesn't rstrip / from argument, "breaks" QA...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal major with 1 vote (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
: 411665 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-16 03:54 UTC by Sławomir Nizio
Modified: 2012-11-07 07:45 UTC (History)
4 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 Sławomir Nizio 2012-02-16 03:54:45 UTC
let's see the example:
- with pax-utils 0.2.3
# scanelf -yqRBF '#k%F' -k '!.symtab' /usr/bin/ | head -n 2
/usr/bin/bzz
/usr/bin/ntfstruncate

- and with 0.3.0
$ ./scanelf -yqRBF '#k%F' -k '!.symtab' /usr/bin/ | head -n 2
/usr/bin//bzz
/usr/bin//ntfstruncate

I can reproduce it on my system and on another, Gentoo based, with pax-utils 0.3.0 compiled by hand.
I think it can be a bug in scanelf or otherwise the 'prestrip' helper needs to be fixed.

Problem is, if you provide a path that ends with a `/', two slashes are printed.
Didn't try many `/' on the end of the path argument or different arguments to scanelf.

Now, seems to "break" the prestrip Portage's helper so it always prints warnings about prestripped stuff. Example with Opera:
 * QA Notice: Pre-stripped files found:
 * //usr/lib/opera/gstreamer/plugins/libgstoperavp8.so
 * //usr/lib/opera/gstreamer/plugins/libgstoperamatroska.so
 * //usr/lib/opera/operaplugincleaner
 * //usr/lib/opera/opera
 * //usr/lib/opera/liboperagtk2.so
 * //usr/lib/opera/operapluginwrapper.

Here (in the helper), problem starts around the line:
scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED}##" > "$log"

analysis follow :P
- "$@" for scanelf = "/var/tmp/portage/www-client/opera-11.61.1250/image/" (slash ends the arg.)

- scanelf thus prints something like:
/var/tmp/portage/www-client/opera-11.61.1250/image//usr/lib/opera/opera (note "//")

- "$ED" = "/var/tmp/portage/www-client/opera-11.61.1250/image/"

- scanelf's output is piped to sed resulting in lines like:
/usr/lib/opera/opera (note / on the beginning)

- stuff from $QA_PRESTRIPPED is iterated, with / from the beginning removed, resulting with sed invocation like:
sed -e s#^usr/lib/opera/.*$##  <etc.> (note it wants no / on the beginning)

- the check fails (or rather, substitution isn't made) and thus the warning is issued.

Another parts of this ebuild helper can be affected or anything. I didn't check - this bothered me, displayed the 'prestripped' warning despite of the QA_… variable.

Reproducible: Always




Not sure about severity of the bug so I'll rise it a little.
Comment 1 Sławomir Nizio 2012-02-16 14:33:48 UTC
I forgot about emerge --info.

Portage 2.2.0_alpha84 (default/linux/x86/10.0/desktop, gcc-4.6.2, glibc-2.13-r4, 3.0.0-sabayon i686)
=================================================================
System uname: Linux-3.0.0-sabayon-i686-AMD_Athlon-tm-_XP_1700+-with-gentoo-2.0.3
Timestamp of tree: Fri, 10 Feb 2012 11:00:01 +0000
ccache version 3.1.7 [disabled]
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.6-r1, 2.7.2
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.7-r2
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3-r1::sabayon
sys-apps/openrc:          0.9.8.1::sabayon-distro
sys-apps/sandbox:         2.4
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.4_p6-r1, 1.6.3, 1.8.5-r4, 1.9.6-r2, 1.11.1
sys-devel/binutils:       2.20.1-r1
sys-devel/gcc:            4.6.2::sabayon-distro
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39
sys-libs/glibc:           2.13-r4::sabayon-distro
Repositories: gentoo user_defined
Installed sets: @system
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/entropy /usr/share/config/kdm /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/grub.d /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/skel /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1,--as-needed"
LINGUAS="en en_US af ar az bg bn br bs ca cs cy da de el en_GB eo es et eu fa fi fr fy ga gl he hi hr hu is it ja kk km ko lt lv mk mn ms nb nds nl nn pa pl pt pt_BR ro ru rw se sk sl sr sr@Latn ss sv ta tg tr uk uz vi zh_CN zh_TW es_AR es_ES fy_NL ga_IE gu gu_IN nb_NO nn_NO pt_PT sv_SE zh"
MAKEOPTS="-j2 -s "
PKGDIR="/usr/portage/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="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac accessibility acl acpi aiglx aim alsa artswrappersuid audiofile avahi bash-completion berkdb bidi bluetooth bzip2 cairo cdda cddb cdr cjk cli consolekit cpudetection cracklib crypt cups cxx dbus dga dri dts dv dvb dvd dvdr dvdread dvi emboss encode exif fam fame fat ffmpeg firefox flac foomatic-db fortran freetype gcj gdbm gdu gif gimpprint gmp gnutls gphoto2 gpm gsm gtk hal hfs iconv icq ieee1394 imap inotify ipod ipv6 irc irda jabber jack jfs joystick jpeg kde kdeenablefinal kdehiddenvisibility kerberos lame lcd lcms ldap libnotify live lm_sensors lzo mad mail matroska mjpeg mmx mng modules mozdevelop mp3 mp3rtp mp4 mpeg msn mudflap musepack musicbrainz ncurses network nls nptl nptlonly nsplugin ntfs ogg openal openexr opengl openmp pam pango pcmcia pcre pda pdf png policykit ppds pppd pulseaudio qt3support qt4 rar rdesktop readline reiserfs rss scanner sdl session slp speex spell ssl startup-notification stream svg sysfs tcpd theora tiff truetype udev unicode usb v4l v4l2 visualization vorbis wifi win32codecs wmf x264 x86 xcb xfs xine xinerama xml xorg xpm xprint xulrunner xv xvid xvmc yahoo zeroconf zlib" ALSA_CARDS="emu10k1x darla20 darla24 emu10k1 gina20 gina24 hdsp hdspm ice1712 indigo indigoio layla20 layla24 mia mixart mona pcxhr rme32 rme96 sb16 sbawe sscape usbusx2y vx222 usb-usx2y" 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" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="agfa_cl20 casio_qv dimagev dimera3500 kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica_qm150 panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l859 polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ricoh_g3 sipix_blink sipix_blink2 sipix_web2 sony_dscf1 sony_dscf55 toshiba_pdrm11 adc65 aox barbie canon clicksmart310 digigr8 digita directory enigma13 fuji gsmart300 hp215 iclick jamcam jd11 konica largan lg_gsm mars mustek pccam300 pccam600 ptp2 ricoh samsung sierra smal sonix soundvision spca50x sq905 stv0674 stv0680 sx330z template" 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 keyboard mouse void" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US af ar az bg bn br bs ca cs cy da de el en_GB eo es et eu fa fi fr fy ga gl he hi hr hu is it ja kk km ko lt lv mk mn ms nb nds nl nn pa pl pt pt_BR ro ru rw se sk sl sr sr@Latn ss sv ta tg tr uk uz vi zh_CN zh_TW es_AR es_ES fy_NL ga_IE gu gu_IN nb_NO nn_NO pt_PT sv_SE zh" LIRC_DEVICES="audio audio_alsa serial" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev vesa radeonhd" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 SpanKY gentoo-dev 2012-03-30 03:19:01 UTC
don't know why this is assigned to hardened
Comment 3 Sławomir Nizio 2012-03-30 17:22:08 UTC
pax-utils seems to be "run" by Gentoo hardened project: http://www.gentoo.org/proj/en/hardened/ hence the wrong assignment. Now I'll know.
Comment 4 SpanKY gentoo-dev 2012-03-30 18:53:25 UTC
the metadata.xml contains maintainer ship information, not arbitrary URLs
Comment 5 Sławomir Nizio 2012-03-30 19:56:07 UTC
Yes, but it's not an ebuild issue but paxutil itself, so I thought of selecting the Gentoo Hosted "product" ("All Gentoo Hosted Project (OpenRC, catalyst, genkernel, tenchi, etc.) bug reports.") which set the assignee automatically.

Whatever. Seems I was wrong. Thanks for the reply. :)
Comment 6 SpanKY gentoo-dev 2012-04-16 14:49:48 UTC
*** Bug 411665 has been marked as a duplicate of this bug. ***
Comment 7 SpanKY gentoo-dev 2012-04-28 05:20:48 UTC
thanks for the small test.  looks like i inadvertently broke it here:
http://sources.gentoo.org/gentoo-projects/pax-utils/scanelf.c?r1=1.231&r2=1.232
Comment 8 SpanKY gentoo-dev 2012-04-29 05:41:24 UTC
should be fixed in the next release

http://sources.gentoo.org/gentoo-projects/pax-utils/scanelf.c?r1=1.242&r2=1.243
Comment 9 Sławomir Nizio 2012-04-29 13:34:27 UTC
Thanks.