mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-26 19:41:35 +08:00
Add support for umask when exec container
Signed-off-by: WangXiaoSong <wang.xiaosong1@zte.com.cn>
This commit is contained in:

committed by
WangXiaoSong

parent
5a0642d6fd
commit
7b4c3fc111
@@ -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
|
||||
}
|
||||
|
@@ -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"* ]]
|
||||
}
|
||||
|
Reference in New Issue
Block a user