On 3/26/22 18:54, Kyle Glaws wrote:
When the shared library is missing, execvp will set errno to ENOENT. In
that event, it might be possible to stat the path to the command to confirm
that the command does not exist.
That would lead to a race condition, in case the file in question is
removed or created between the time that execvp fails and stat is called.
Plus: why should chroot be any different from other commands that
invoke execvp and then rely on errno to say why execvp failed? Will we
need to modify every command that invokes execvp? If so, this would
indicate a bug in execvp rather than in every command that uses execvp.