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

Method ValidatePIDWithOwnership

lib/process_validator.go:97–112  ·  view source on GitHub ↗

ValidatePIDWithOwnership performs comprehensive PID validation including process ownership checks

(pid int)

Source from the content-addressed store, hash-verified

95
96// ValidatePIDWithOwnership performs comprehensive PID validation including process ownership checks
97func (pv *ProcessValidator) ValidatePIDWithOwnership(pid int) error {
98 // First perform basic PID validation
99 if err := pv.ValidatePID(pid); err != nil {
100 return err
101 }
102
103 // Then perform ownership validation
104 if err := pv.validateProcessOwnership(pid); err != nil {
105 return PIDValidationError{
106 PID: pid,
107 Message: fmt.Sprintf("ownership validation failed: %s", err.Error()),
108 }
109 }
110
111 return nil
112}
113
114// validateProcessOwnership checks if the process belongs to an allowed parent
115func (pv *ProcessValidator) validateProcessOwnership(pid int) error {

Callers 2

ValidateProcessListMethod · 0.95
handleKillInstancesFunction · 0.95

Calls 3

ValidatePIDMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected