This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][v2] Add dynamic linker support for $EXEC_ORIGIN.
On Wed, Oct 25, 2017 at 9:24 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> On 25/10/17 16:54, Paul Pluzhnikov wrote:
>> On Wed, Oct 25, 2017 at 8:36 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>>
>>> and Rich Felker notes that it can be hacked around
>>> without elf changes using wrapper scripts like
>>>
>>> exec /lib/ld-linux.so.2 --library-path /path/with/dso/symlinks /path/to/exe "$@"
>>
>> That hack has its own set of problems. E.g. it doesn't work for Java,
>> which likes to set environment variables to its liking and then
>> re-execs itself.
>>
>
> how does that work with the proposed *_ORIGIN patch?
IIRC, they do "execvp(argv[0], argv)" or "execvpe(argv[0], argv,
env)", so *_ORIGIN works fine.
> if they do execve(/proc/self/exe, argv, envp) then
> that should break too.
True.
--
Paul Pluzhnikov