tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Proposal: getexecpath(3)
> Date: Mon, 26 Oct 2026 07:04:08 -0400 (EDT)
> From: Mouse <mouse%Rodents-Montreal.ORG@localhost>
>
> > You can always pass the original verbatim exec path to realpath(3) if
> > you want to canonicalize it,
>
> True, though that - at best - returns the hard path at the time of
> realpath (or more precisely with pieces fetched at various times
> scattered throughout the execution of realpath), which may not be the
> same as the one at the time of exec.
If the path resolution may have concurrently changed between the
execve call and the realpath call, it may as well have concurrently
changed between the execve call and the open call.
In other words, this race condition is inherent to the nature of
passing a path around; it cannot be avoided by asking the kernel to do
(the equivalent of) realpath.
Home |
Main Index |
Thread Index |
Old Index