mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-05 07:27:03 +08:00
Vendor in latest selinux code for keycreate errors
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
9
vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go
generated
vendored
9
vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go
generated
vendored
@@ -406,7 +406,14 @@ func SocketLabel() (string, error) {
|
||||
// SetKeyLabel takes a process label and tells the kernel to assign the
|
||||
// label to the next kernel keyring that gets created
|
||||
func SetKeyLabel(label string) error {
|
||||
return writeCon("/proc/self/attr/keycreate", label)
|
||||
err := writeCon("/proc/self/attr/keycreate", label)
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
if label == "" && os.IsPermission(err) && !GetEnabled() {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// KeyLabel retrieves the current kernel keyring label setting
|
||||
|
Reference in New Issue
Block a user