diff options
| author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-29 17:40:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-29 17:40:43 +0200 |
| commit | 42903b785cb8476d87b7306860e1f2a1003c1662 (patch) | |
| tree | dd6123b4b08fe98dc386949615bf944150eac640 /vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go | |
| parent | 00f0bb516cf2fb26917307d1639edb20e92e5363 (diff) | |
| parent | f00ceaabd497e87415f6926de50478260cd7e844 (diff) | |
| download | podman-42903b785cb8476d87b7306860e1f2a1003c1662.tar.gz podman-42903b785cb8476d87b7306860e1f2a1003c1662.tar.bz2 podman-42903b785cb8476d87b7306860e1f2a1003c1662.zip | |
Merge pull request #15987 from flouthoc/bump-common
vendor: bump c/common to `v0.49.2-0.20220929111928-2d1b45ae2423`
Diffstat (limited to 'vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go')
| -rw-r--r-- | vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go index 12de0ae5d..f61a56015 100644 --- a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go +++ b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go @@ -3,8 +3,6 @@ package label import ( "errors" "fmt" - "os" - "os/user" "strings" "github.com/opencontainers/selinux/go-selinux" @@ -113,50 +111,6 @@ func Relabel(path string, fileLabel string, shared bool) error { return nil } - exclude_paths := map[string]bool{ - "/": true, - "/bin": true, - "/boot": true, - "/dev": true, - "/etc": true, - "/etc/passwd": true, - "/etc/pki": true, - "/etc/shadow": true, - "/home": true, - "/lib": true, - "/lib64": true, - "/media": true, - "/opt": true, - "/proc": true, - "/root": true, - "/run": true, - "/sbin": true, - "/srv": true, - "/sys": true, - "/tmp": true, - "/usr": true, - "/var": true, - "/var/lib": true, - "/var/log": true, - } - - if home := os.Getenv("HOME"); home != "" { - exclude_paths[home] = true - } - - if sudoUser := os.Getenv("SUDO_USER"); sudoUser != "" { - if usr, err := user.Lookup(sudoUser); err == nil { - exclude_paths[usr.HomeDir] = true - } - } - - if path != "/" { - path = strings.TrimSuffix(path, "/") - } - if exclude_paths[path] { - return fmt.Errorf("SELinux relabeling of %s is not allowed", path) - } - if shared { c, err := selinux.NewContext(fileLabel) if err != nil { |
