[ CCode ( type_id = "polkit_unix_process_get_type ()" ) ]
public class UnixProcess : Object, Subject
An object for representing a UNIX process.
In order to be reliable and race-free, this requires support for PID File Descriptors in the kernel, dbus-daemon/broker and systemd. With this functionality, we can reliably track processes without risking PID reuse and race conditions, and compare them.
NOTE: If PID FDs are not available, this object will fall back to using PIDs, and this designed is now known broken; a mechanism to exploit a delay in start time in the Linux kernel was identified. Avoid calling equal to compare two processes.
To uniquely identify processes, both the process id and the start time of the process (a monotonic increasing value representing the time since the kernel was started) is used.
NOTE: This object stores, and provides access to, the real UID of the process. That value can change over time (with set*uid*(2) and
exec*(2)). Checks whether an operation is allowed need to take care to use the UID value as of the time when the operation was made (or,
following the open privilege check model, when the connection making the operation possible was initiated). That is usually
done by initializing this with UnixProcess.for_owner
with trusted data.