HomeFreeBSD

exec: provide right hardlink name in AT_EXECPATH

Description

exec: provide right hardlink name in AT_EXECPATH

For this, use vn_fullpath_hardlink() to resolve executable name for
execve(2).

This should provide the right hardlink name, used for execution, instead
of random hardlink pointing to this binary. Also this should make the
AT_EXECNAME reliable for execve(2), since kernel only needs to resolve
parent directory path, which should always succeed (except pathological
cases like unlinking a directory).

PR: 248184
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32611

Details

Provenance
kibAuthored on Oct 23 2021, 12:24 AM
Reviewer
markj
Differential Revision
D32611: exec: provide right hardlink name in AT_EXECPATH
Parents
rG9a0bee9f6a77: Make vn_fullpath_hardlink() externally callable
Branches
Unknown
Tags
Unknown