diff options
author | dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> | 2020-12-16 10:17:15 +0000 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-12-16 13:35:31 -0500 |
commit | 3bf037d3e8215760a5221bee74973906fe2a356f (patch) | |
tree | 145ca37f4c1cef0d2e243b1ea51f326fa969fbfe /vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go | |
parent | bacb2fc526dba7214e3c8420eccc5cf22bbb1a29 (diff) | |
download | podman-3bf037d3e8215760a5221bee74973906fe2a356f.tar.gz podman-3bf037d3e8215760a5221bee74973906fe2a356f.tar.bz2 podman-3bf037d3e8215760a5221bee74973906fe2a356f.zip |
Bump github.com/opencontainers/selinux from 1.7.0 to 1.8.0
Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/opencontainers/selinux/releases)
- [Commits](https://github.com/opencontainers/selinux/compare/v1.7.0...v1.8.0)
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go')
-rw-r--r-- | vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go new file mode 100644 index 000000000..117c255be --- /dev/null +++ b/vendor/github.com/opencontainers/selinux/go-selinux/xattrs_linux.go @@ -0,0 +1,38 @@ +package selinux + +import ( + "golang.org/x/sys/unix" +) + +// lgetxattr returns a []byte slice containing the value of +// an extended attribute attr set for path. +func lgetxattr(path, attr string) ([]byte, error) { + // Start with a 128 length byte array + dest := make([]byte, 128) + sz, errno := doLgetxattr(path, attr, dest) + for errno == unix.ERANGE { + // Buffer too small, use zero-sized buffer to get the actual size + sz, errno = doLgetxattr(path, attr, []byte{}) + if errno != nil { + return nil, errno + } + + dest = make([]byte, sz) + sz, errno = doLgetxattr(path, attr, dest) + } + if errno != nil { + return nil, errno + } + + return dest[:sz], nil +} + +// doLgetxattr is a wrapper that retries on EINTR +func doLgetxattr(path, attr string, dest []byte) (int, error) { + for { + sz, err := unix.Lgetxattr(path, attr, dest) + if err != unix.EINTR { + return sz, err + } + } +} |