mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
9880e6a1ef
- relabel links instead of their targets full diff: https://github.com/opencontainers/selinux/compare/v1.10.0...v1.10.1 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
22 lines
411 B
Go
22 lines
411 B
Go
// +build linux,go1.16
|
|
|
|
package selinux
|
|
|
|
import (
|
|
"errors"
|
|
"io/fs"
|
|
"os"
|
|
|
|
"github.com/opencontainers/selinux/pkg/pwalkdir"
|
|
)
|
|
|
|
func rchcon(fpath, label string) error {
|
|
return pwalkdir.Walk(fpath, func(p string, _ fs.DirEntry, _ error) error {
|
|
e := lSetFileLabel(p, label)
|
|
// Walk a file tree can race with removal, so ignore ENOENT.
|
|
if errors.Is(e, os.ErrNotExist) {
|
|
return nil
|
|
}
|
|
return e
|
|
})
|
|
}
|