Skip to content
  • Laszlo Ersek's avatar
    CONNECT_COMMAND.START: replace execvp() call with fork-safe variant · a48a1142
    Laszlo Ersek authored
    
    
    Per POSIX, execvp() is not safe to call in a child process forked from a
    multi-threaded process. We can now replace the execvp() call in the child
    process with a call to our fork-safe (async-signal-safe) variant.
    
    Prepare our internal execvpe context on the parent's construction path,
    use the context in the child, and release the context in the parent on the
    way out, regardless of whether the handler as a whole succeeded or not.
    (The context is only a temporary resource.)
    
    Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
    Reviewed-by: default avatarRichard W.M. Jones <rjones@redhat.com>
    Message-Id: <20230323121016.1442655-16-lersek@redhat.com>
    a48a1142