func readSeccompFields()

in providers/linux/seccomp_linux.go [47:69]


func readSeccompFields(content []byte) (*types.SeccompInfo, error) {
	var seccomp types.SeccompInfo

	err := parseKeyValue(content, ':', func(key, value []byte) error {
		switch string(key) {
		case "Seccomp":
			mode, err := strconv.ParseUint(string(value), 10, 8)
			if err != nil {
				return err
			}
			seccomp.Mode = SeccompMode(mode).String()
		case "NoNewPrivs":
			noNewPrivs, err := strconv.ParseBool(string(value))
			if err != nil {
				return err
			}
			seccomp.NoNewPrivs = &noNewPrivs
		}
		return nil
	})

	return &seccomp, err
}