This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Should /proc/self/exe preempt LD_ORIGIN_PATH ?
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 26 Mar 2010 15:28:59 -0700
- Subject: Should /proc/self/exe preempt LD_ORIGIN_PATH ?
Greetings,
http://www.kernel.org/doc/man-pages/online/pages/man8/ld.so.8.html
says this about LD_ORIGIN_PATH:
(glibc since 2.1) Path where the binary is found (for non-set-user-ID
programs). For security reasons, since glibc 2.4, LD_ORIGIN_PATH is
ignored for set-user-ID/set-group-ID binaries.
which makes me believe that setting LD_ORIGIN_PATH was intended to
affect '$ORIGIN' expansion.
It doesn't on Linux, because sysdeps/unix/sysv/linux/dl-origin.c uses
GLRO(dl_origin_path) only if readlink("/proc/self/exe") fails.
When an executable is invoked via symlink, the kernel expands
/proc/self/exe to the target of the link, and it is easy to construct
a case where this will cause executable to fail to find its NEEDED
shared libraries. I expected LD_ORIGIN_PATH to help in that case, but
it doesn't. Is that a bug?
AFAICT, manual/libc.texinfo doesn't mention LD_ORIGIN_PATH at all, and
I don't know what other documentation would be authoritative.
Thanks,
--
Paul Pluzhnikov