/
wax_boy
/
semaphore_custom
Обзор
Документация
Войти
/
wax_boy
/
semaphore_custom
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
util/config_sysproc_linux.go
43 строки
919 B
Denis Gukov
refactor/sync flag (#3793)
25 апр 2026, 02:14
Не верифицирован
25 апр 2026, 02:14
ebd41b9
Код
Авторство
О чём код?
//go:build linux package util import "syscall" // GetAppSysProcAttr returns SysProcAttr for child apps (ansible, terraform, // shell templates). It builds on top of GetSysProcAttr and adds Linux // namespace isolation flags when configured. It is NOT used for git: git // needs host access for SSH agents and credential helpers. func (conf *ConfigType) GetAppSysProcAttr() *syscall.SysProcAttr { res := conf.GetSysProcAttr() flags := conf.Process.AppNamespaces.cloneFlags() if flags == 0 { return res } if res == nil { res = &syscall.SysProcAttr{} } res.Cloneflags |= flags return res } func (ns ConfigAppNamespaces) cloneFlags() (flags uintptr) { if ns.User { flags |= syscall.CLONE_NEWUSER } if ns.Mount { flags |= syscall.CLONE_NEWNS } if ns.PID { flags |= syscall.CLONE_NEWPID } if ns.IPC { flags |= syscall.CLONE_NEWIPC } if ns.UTS { flags |= syscall.CLONE_NEWUTS } return }