mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-05 23:46:57 +08:00
vendor: update opencontainers/selinux v1.3.1
full diff: 5215b1806f
...v1.3.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
12
vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go
generated
vendored
12
vendor/github.com/opencontainers/selinux/go-selinux/selinux_linux.go
generated
vendored
@@ -7,7 +7,6 @@ import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@@ -19,6 +18,7 @@ import (
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
@@ -289,7 +289,10 @@ func SetFileLabel(fpath string, label string) error {
|
||||
if fpath == "" {
|
||||
return ErrEmptyPath
|
||||
}
|
||||
return lsetxattr(fpath, xattrNameSelinux, []byte(label), 0)
|
||||
if err := lsetxattr(fpath, xattrNameSelinux, []byte(label), 0); err != nil {
|
||||
return errors.Wrapf(err, "failed to set file label on %s", fpath)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// FileLabel returns the SELinux label for this path or returns an error.
|
||||
@@ -370,7 +373,10 @@ func writeCon(fpath string, val string) error {
|
||||
} else {
|
||||
_, err = out.Write(nil)
|
||||
}
|
||||
return err
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to set %s on procfs", fpath)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user