MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / validateProcessOwnership

Method validateProcessOwnership

lib/process_validator.go:115–124  ·  view source on GitHub ↗

validateProcessOwnership checks if the process belongs to an allowed parent

(pid int)

Source from the content-addressed store, hash-verified

113
114// validateProcessOwnership checks if the process belongs to an allowed parent
115func (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
127func (pv *ProcessValidator) validateUnixProcessOwnership(pid int) error {

Callers 1

Tested by

no test coverage detected