HomeFreeBSD

Fix AT_EXECPATH for direct exec mode.

Description

Fix AT_EXECPATH for direct exec mode.

When activated in direct exec mode, kernel-provided AT_EXECPATH points
to the interpreter. We need to recalculate auxv to point to the
string with the path to the executable which is actually executed.

The somewhat problematic case is when the executable path is relative
and either $PATH use is not enabled or it contains '/' so $PATH search
is not performed. In this case resulting AT_EXECPATH is relative, I
might fix this later.

Reported and reviewed by: rstone
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D22894

Details

Provenance
kibAuthored on
Differential Revision
D22894: Fix AT_EXECPATH for direct exec mode.
Parents
rS356299: MFC r354344: iflib: properly release memory allocated for DMA
Branches
Unknown
Tags
Unknown