tree-wide: extend $LISTEN_FDS protocol with $LISTEN_PIDFDID

Although extremely unlikely, there is a race present in solely checking the
$LISTEN_PID environment variable, due to PID recycling. Fix that by introducing
$LISTEN_PIDFDID, which contains the 64-bit ID of a pidfd for the child process
that is not subject to recycling.
This commit is contained in:
Daniel Foster
2025-10-22 09:34:14 +02:00
committed by Lennart Poettering
parent 93b6d43253
commit c7a444a9c1
16 changed files with 124 additions and 23 deletions
+1
View File
@@ -4207,6 +4207,7 @@ StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZX
<varlistentry>
<term><varname>$LISTEN_FDS</varname></term>
<term><varname>$LISTEN_PID</varname></term>
<term><varname>$LISTEN_PIDFDID</varname></term>
<term><varname>$LISTEN_FDNAMES</varname></term>
<listitem><para>Information about file descriptors passed to a