Skip to content

Validates pid returned by TerminalInterface::foregroundProcessId

Theodore Wang requested to merge theodorewang12/my-konsole:validatepid into master

This change attempts to resolve a "FIXME: find a good way to validate process id of 'top'" for three systems: Solars, OpenBSD and Linux. This is done by confirming that the return value of TerminalInterface::foregroundProcessId belongs to a process and that the process has the correct name. For Linux, this entails reading the name of the process from /proc/%pid/stat. For Solaris, this entails reading from /proc/%pid/execname. For OpenBSD, this is done through the p_comm field of a struct kinfo_proc returned by a call to kvm_getprocs.

Merge request reports