MCPcopy
hub / github.com/opencontainers/runc / validateProcessSpec

Function validateProcessSpec

utils_linux.go:340–357  ·  view source on GitHub ↗
(spec *specs.Process)

Source from the content-addressed store, hash-verified

338}
339
340func validateProcessSpec(spec *specs.Process) error {
341 if spec == nil {
342 return errors.New("process property must not be empty")
343 }
344 if spec.Cwd == "" {
345 return errors.New("Cwd property must not be empty")
346 }
347 if !filepath.IsAbs(spec.Cwd) {
348 return errors.New("Cwd must be an absolute path")
349 }
350 if len(spec.Args) == 0 {
351 return errors.New("args must not be empty")
352 }
353 if spec.SelinuxLabel != "" && !selinux.GetEnabled() {
354 return errors.New("selinux label is specified in config, but selinux is disabled or not supported")
355 }
356 return nil
357}
358
359type CtAct uint8
360

Callers 2

loadSpecFunction · 0.85
getProcessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…