DevHeads.net

rpath/runpath in binaries

Hi,

I missed the memo about it not being a fatal error now (rpmlint still tells it
is an error), but just in case, before attempting to enforce it a
package review,
I checked what I have right now in my rawhide box...

$ for f in /usr/bin/*; do file $f | grep -q ELF && chrpath -l $f |
grep -v "no rpath or runpath tag found"; done
/usr/bin/afm2pl: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/afm2tfm: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/aleph: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/apper: RUNPATH=/usr/lib64/apper
/usr/bin/applygeo: RPATH=/usr/lib64
/usr/bin/bibtex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/bibtex8: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/bibtexu: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/catman: RPATH=/usr/lib64/man-db
/usr/bin/certtool: RPATH=/usr/lib64
/usr/bin/chktex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/crywrap: RPATH=/usr/lib64
/usr/bin/ctangle: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/ctie: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/cweave: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/danetool: RPATH=/usr/lib64
/usr/bin/dbus-binding-tool: RPATH=/usr/lib64
/usr/bin/dee-tool: RPATH=/usr/lib64
/usr/bin/detex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dia: RPATH=/usr/lib64/dia
/usr/bin/disdvi: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dt2dv: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dumpiso: RPATH=/usr/lib64
/usr/bin/dv2dt: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvi2tty: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvibook: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dviconcat: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvicopy: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvilj: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvilj2p: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvilj4: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvilj4l: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvipdfmx: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvipng: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvipos: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvips: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dviselect: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvisvgm: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvitodvi: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/dvitype: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/enca: RPATH=/usr/lib64
/usr/bin/eptex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/euptex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/eventlogadm: RPATH=/usr/lib64/samba
/usr/bin/fribidi: RPATH=/usr/lib64
/usr/bin/gegl: RPATH=/usr/lib64
/usr/bin/geotifcp: RPATH=/usr/lib64
/usr/bin/gftodvi: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/gftopk: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/gftype: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/ggobi: RPATH=/usr/lib64
`/usr/bin/gio-querymodules-32' probably isn't a 64-bit LSB-first ELF file.
elf_open: Exec format error
/usr/bin/gnutls-cli: RPATH=/usr/lib64
/usr/bin/gnutls-cli-debug: RPATH=/usr/lib64
/usr/bin/gnutls-serv: RPATH=/usr/lib64
/usr/bin/gsftopk: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/gvpack: RPATH=/usr/lib64/graphviz
/usr/bin/hbf2gf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/htdb_dump: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htdb_load: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htdb_stat: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htdig: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htdump: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htfuzzy: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htload: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htmerge: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htnotify: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htpurge: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htsearch: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/htstat: RPATH=/usr/lib64/htdig:/usr/lib64/htdig_db
/usr/bin/julia-debug: RUNPATH=$ORIGIN/../lib64/julia:$ORIGIN/../lib64
/usr/bin/kpsewhich: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/ld.bfd: RPATH=/usr/lib64
/usr/bin/lexgrog: RPATH=/usr/lib64/man-db
/usr/bin/listgeo: RPATH=/usr/lib64
/usr/bin/luatex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/lynx: RPATH=/usr/lib64
/usr/bin/mag: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/makeindex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/makejvf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/man: RPATH=/usr/lib64/man-db
/usr/bin/mandb: RPATH=/usr/lib64/man-db
/usr/bin/manpath: RPATH=/usr/lib64/man-db
/usr/bin/mbimcli: RPATH=/usr/lib64
/usr/bin/mcpp: RPATH=/usr/lib64
/usr/bin/mendex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/mf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/mf-nowin: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/mft: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/mpost: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/net: RPATH=/usr/lib64/samba
/usr/bin/ntlm_auth: RPATH=/usr/lib64/samba
/usr/bin/ocsptool: RPATH=/usr/lib64
/usr/bin/odvicopy: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/odvitype: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/omfonts: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/openjade: RPATH=/usr/lib64
/usr/bin/otangle: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/otftotfm: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/otp2ocp: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/outocp: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/p11tool: RPATH=/usr/lib64
/usr/bin/pacat: RPATH=/usr/lib64/pulseaudio
/usr/bin/pacmd: RPATH=/usr/lib64/pulseaudio
/usr/bin/pactl: RPATH=/usr/lib64/pulseaudio
/usr/bin/pasuspender: RPATH=/usr/lib64/pulseaudio
/usr/bin/patgen: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pax11publish: RPATH=/usr/lib64/pulseaudio
/usr/bin/pbibtex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pdbedit: RPATH=/usr/lib64/samba
/usr/bin/pdftex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pdftosrc: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pdvitype: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pfb2pfa: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pktogf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pktype: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/plistutil: RPATH=/usr/lib64
/usr/bin/pltotf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pngfix: RPATH=/usr/lib64
/usr/bin/pooltype: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/potrace: RPATH=/usr/lib64
/usr/bin/ppltotf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/profiles: RPATH=/usr/lib64/samba
/usr/bin/ps2pk: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/psktool: RPATH=/usr/lib64
/usr/bin/ptex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/ptftopl: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/pulseaudio: RPATH=/usr/lib64/pulseaudio
/usr/bin/qmicli: RPATH=/usr/lib64
/usr/bin/rarian-example: RPATH=/usr/lib64
/usr/bin/rarian-sk-gen-uuid: RPATH=/usr/lib64
/usr/bin/rarian-sk-get-cl: RPATH=/usr/lib64
/usr/bin/rarian-sk-migrate: RPATH=/usr/lib64
/usr/bin/rarian-sk-preinstall: RPATH=/usr/lib64
/usr/bin/sasl2-sample-client: RPATH=/usr/lib64
/usr/bin/sasl2-sample-server: RPATH=/usr/lib64
/usr/bin/sendiso: RPATH=/usr/lib64
/usr/bin/showimage: RPATH=/usr/lib64
/usr/bin/sip_reg: RPATH=/usr/lib64
/usr/bin/smbcontrol: RPATH=/usr/lib64/samba
/usr/bin/smbstatus: RPATH=/usr/lib64/samba
/usr/bin/spd-say: RPATH=/usr/lib64
/usr/bin/sss_ssh_authorizedkeys: RPATH=/usr/lib64/sssd
/usr/bin/sss_ssh_knownhostsproxy: RPATH=/usr/lib64/sssd
/usr/bin/t4ht: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/tangle: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/testlibraw: RPATH=/usr/lib64
/usr/bin/testparm: RPATH=/usr/lib64/samba
/usr/bin/tex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/tex4ht: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/tftopl: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/tie: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/tpmtool: RPATH=/usr/lib64
/usr/bin/ttf2afm: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/ttf2pk: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/ttf2tfm: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/ttfdump: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/udisksctl: RPATH=/usr/lib64
/usr/bin/upbibtex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/updvitype: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/uppltotf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/uptex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/uptftopl: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/vftovp: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/vptovf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/wbinfo: RPATH=/usr/lib64/samba
/usr/bin/weave: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/whatis: RPATH=/usr/lib64/man-db
/usr/bin/wovp2ovf: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/xdvipdfmx: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/xdvi-xaw: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/xetex: RPATH=/builddir/build/BUILD/texlive-2014/source/inst/lib
/usr/bin/yap: RUNPATH=/usr/lib64/Yap
/usr/bin/zeitgeist-daemon: RPATH=/usr/lib64
/usr/bin/zeitgeist-datahub: RPATH=/usr/lib64

$ for f in /usr/sbin/*; do file $f | grep -q ELF && chrpath -l $f |
grep -v "no rpath or runpath tag found"; done
/usr/sbin/accessdb: RPATH=/usr/lib64/man-db
/usr/sbin/cryptsetup: RPATH=/usr/lib64
/usr/sbin/ebtables: RPATH=/lib64/ebtables
/usr/sbin/ebtables-restore: RPATH=/lib64/ebtables
`/usr/sbin/iconvconfig.i686' probably isn't a 64-bit LSB-first ELF file.
elf_open: Exec format error
No dynamic section found.
found no dynamic section: Success
/usr/sbin/nmbd: RPATH=/usr/lib64/samba
/usr/sbin/pluginviewer: RPATH=/usr/lib64
No dynamic section found.
found no dynamic section: Success
/usr/sbin/sasl2-shared-mechlist: RPATH=/usr/lib64
/usr/sbin/sasldblistusers2: RPATH=/usr/lib64
/usr/sbin/saslpasswd2: RPATH=/usr/lib64
No dynamic section found.
found no dynamic section: Success
/usr/sbin/smbd: RPATH=/usr/lib64/samba
/usr/sbin/sss_cache: RPATH=/usr/lib64/sssd
/usr/sbin/sssd: RPATH=/usr/lib64/sssd
/usr/sbin/umount.udisks2: RPATH=/usr/lib64
/usr/sbin/winbindd: RPATH=/usr/lib64/samba

BTW, The package I am reviewing has this
/usr/bin/julia-debug: RUNPATH=$ORIGIN/../lib64/julia:$ORIGIN/../lib64

Thanks,
Paulo

Comments

Re: rpath/runpath in binaries

By Rex Dieter at 09/22/2014 - 10:58

Note that not *all* RPATHs are bad. In general, those that match these need
further scrutiny:

/usr/lib
/usr/lib64
/builddir/*

In, particular, these are probably OK:

/usr/bin/apper: RUNPATH=/usr/lib64/apper
/usr/bin/catman: RPATH=/usr/lib64/man-db
/usr/bin/pactl: RPATH=/usr/lib64/pulseaudio
/usr/bin/profiles: RPATH=/usr/lib64/samba
/usr/sbin/sssd: RPATH=/usr/lib64/sssd

Offhand, looks like the first part is ok, the second not.

-- Rex