Merge pull request #3661 from Wang-squirrel/dev1

Add support for umask when exec container
This commit is contained in:
Kir Kolyshkin
2023-02-27 19:33:03 -08:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -59,6 +59,10 @@ func (l *linuxSetnsInit) Init() error {
return err
}
}
if l.config.Config.Umask != nil {
unix.Umask(int(*l.config.Config.Umask))
}
if err := selinux.SetExecLabel(l.config.ProcessLabel); err != nil {
return err
}
+5
View File
@@ -21,4 +21,9 @@ function teardown() {
[ "$status" -eq 0 ]
# umask 63 decimal = umask 77 octal
[[ "${output}" == *"77"* ]]
runc exec test_busybox grep '^Umask:' "/proc/self/status"
[ "$status" -eq 0 ]
# umask 63 decimal = umask 77 octal
[[ "${output}" == *"77"* ]]
}