mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-05 07:27:03 +08:00
Fix SELinux failures on disabled SELinux Machines
On some machines when setting the SELinux key labels to "", we are seeing failures that cause runc to fail. Even if SELinux is disabled. This check will ignore callers calling SELinux Set*Label functions with "" when SELinux is disabled. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
5
vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go
generated
vendored
5
vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go
generated
vendored
@@ -333,6 +333,11 @@ func writeCon(fpath string, val string) error {
|
||||
if fpath == "" {
|
||||
return ErrEmptyPath
|
||||
}
|
||||
if val == "" {
|
||||
if !GetEnabled() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
out, err := os.OpenFile(fpath, os.O_WRONLY, 0)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user