validateProcessOwnership checks if the process belongs to an allowed parent
(pid int)
| 113 | |
| 114 | // validateProcessOwnership checks if the process belongs to an allowed parent |
| 115 | func (pv *ProcessValidator) validateProcessOwnership(pid int) error { |
| 116 | switch runtime.GOOS { |
| 117 | case "linux", "darwin": |
| 118 | return pv.validateUnixProcessOwnership(pid) |
| 119 | case "windows": |
| 120 | return pv.validateWindowsProcessOwnership(pid) |
| 121 | default: |
| 122 | return fmt.Errorf("process ownership validation not supported on %s", runtime.GOOS) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | // validateUnixProcessOwnership validates process ownership on Unix-like systems |
| 127 | func (pv *ProcessValidator) validateUnixProcessOwnership(pid int) error { |
no test coverage detected