Merge pull request #40546 from thaJeztah/update_selinux_v1.3.1
vendor: update opencontainers/selinux v1.3.1
This commit is contained in:
commit
498e7185c6
|
@ -161,6 +161,6 @@ github.com/morikuni/aec 39771216ff4c63d11f5e604076f9
|
||||||
# metrics
|
# metrics
|
||||||
github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1
|
github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1
|
||||||
|
|
||||||
github.com/opencontainers/selinux 5215b1806f52b1fcc2070a8826c542c9d33cd3cf
|
github.com/opencontainers/selinux 4defb1c884d2f4f9c890c615380f20f7fc215cf3 # v1.3.1
|
||||||
|
|
||||||
# DO NOT EDIT BELOW THIS LINE -------- reserved for downstream projects --------
|
# DO NOT EDIT BELOW THIS LINE -------- reserved for downstream projects --------
|
||||||
|
|
|
@ -7,7 +7,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
@ -19,6 +18,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -289,7 +289,10 @@ func SetFileLabel(fpath string, label string) error {
|
||||||
if fpath == "" {
|
if fpath == "" {
|
||||||
return ErrEmptyPath
|
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.
|
// FileLabel returns the SELinux label for this path or returns an error.
|
||||||
|
@ -370,7 +373,10 @@ func writeCon(fpath string, val string) error {
|
||||||
} else {
|
} else {
|
||||||
_, err = out.Write(nil)
|
_, err = out.Write(nil)
|
||||||
}
|
}
|
||||||
return err
|
if err != nil {
|
||||||
|
return errors.Wrapf(err, "failed to set %s on procfs", fpath)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
module github.com/opencontainers/selinux
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/pkg/errors v0.8.1
|
||||||
|
golang.org/x/sys v0.0.0-20191115151921-52ab43148777
|
||||||
|
)
|
Loading…
Reference in New Issue