Merge pull request #4383 from dims/update-to-go-systemd-and-selinux-deps
Updates to go-systemd and selinux
This commit is contained in:
commit
4feb8c4623
@ -9,7 +9,7 @@ github.com/containerd/fifo f15a3290365b9d2627d189e619ab
|
|||||||
github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c
|
github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c
|
||||||
github.com/containerd/ttrpc v1.0.1
|
github.com/containerd/ttrpc v1.0.1
|
||||||
github.com/containerd/typeurl v1.0.1
|
github.com/containerd/typeurl v1.0.1
|
||||||
github.com/coreos/go-systemd/v22 v22.0.0
|
github.com/coreos/go-systemd/v22 v22.1.0
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0
|
github.com/cpuguy83/go-md2man/v2 v2.0.0
|
||||||
github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f
|
github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f
|
||||||
github.com/docker/go-metrics v0.0.1
|
github.com/docker/go-metrics v0.0.1
|
||||||
@ -67,7 +67,7 @@ github.com/google/gofuzz v1.1.0
|
|||||||
github.com/json-iterator/go v1.1.9
|
github.com/json-iterator/go v1.1.9
|
||||||
github.com/modern-go/concurrent 1.0.3
|
github.com/modern-go/concurrent 1.0.3
|
||||||
github.com/modern-go/reflect2 v1.0.1
|
github.com/modern-go/reflect2 v1.0.1
|
||||||
github.com/opencontainers/selinux v1.5.1
|
github.com/opencontainers/selinux v1.5.2
|
||||||
github.com/seccomp/libseccomp-golang v0.9.1
|
github.com/seccomp/libseccomp-golang v0.9.1
|
||||||
github.com/tchap/go-patricia v2.2.6
|
github.com/tchap/go-patricia v2.2.6
|
||||||
golang.org/x/crypto bac4c82f69751a6dd76e702d54b3ceb88adab236
|
golang.org/x/crypto bac4c82f69751a6dd76e702d54b3ceb88adab236
|
||||||
|
10
vendor/github.com/coreos/go-systemd/v22/README.md
generated
vendored
10
vendor/github.com/coreos/go-systemd/v22/README.md
generated
vendored
@ -1,7 +1,7 @@
|
|||||||
# go-systemd
|
# go-systemd
|
||||||
|
|
||||||
[](https://travis-ci.org/coreos/go-systemd)
|
[](https://travis-ci.org/coreos/go-systemd)
|
||||||
[](http://godoc.org/github.com/coreos/go-systemd)
|
[](https://pkg.go.dev/mod/github.com/coreos/go-systemd/v22/?tab=packages)
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
@ -24,13 +24,15 @@ https://github.com/coreos/go-systemd/tree/master/examples/activation/httpserver
|
|||||||
|
|
||||||
## systemd Service Notification
|
## systemd Service Notification
|
||||||
|
|
||||||
The `daemon` package is an implementation of the [sd_notify protocol](https://www.freedesktop.org/software/systemd/man/sd_notify.html#Description). It can be used to inform systemd of service start-up completion, watchdog events, and other status changes.
|
The `daemon` package is an implementation of the [sd_notify protocol](https://www.freedesktop.org/software/systemd/man/sd_notify.html#Description).
|
||||||
|
It can be used to inform systemd of service start-up completion, watchdog events, and other status changes.
|
||||||
|
|
||||||
## D-Bus
|
## D-Bus
|
||||||
|
|
||||||
The `dbus` package connects to the [systemd D-Bus API](http://www.freedesktop.org/wiki/Software/systemd/dbus/) and lets you start, stop and introspect systemd units. The API docs are here:
|
The `dbus` package connects to the [systemd D-Bus API](http://www.freedesktop.org/wiki/Software/systemd/dbus/) and lets you start, stop and introspect systemd units.
|
||||||
|
[API documentation][dbus-doc] is available online.
|
||||||
|
|
||||||
http://godoc.org/github.com/coreos/go-systemd/dbus
|
[dbus-doc]: https://pkg.go.dev/github.com/coreos/go-systemd/v22/dbus?tab=doc
|
||||||
|
|
||||||
### Debugging
|
### Debugging
|
||||||
|
|
||||||
|
22
vendor/github.com/opencontainers/selinux/go-selinux/label/label.go
generated
vendored
22
vendor/github.com/opencontainers/selinux/go-selinux/label/label.go
generated
vendored
@ -1,6 +1,8 @@
|
|||||||
package label
|
package label
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/opencontainers/selinux/go-selinux"
|
"github.com/opencontainers/selinux/go-selinux"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -46,7 +48,7 @@ var PidLabel = selinux.PidLabel
|
|||||||
|
|
||||||
// Init initialises the labeling system
|
// Init initialises the labeling system
|
||||||
func Init() {
|
func Init() {
|
||||||
selinux.GetEnabled()
|
_ = selinux.GetEnabled()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearLabels will clear all reserved labels
|
// ClearLabels will clear all reserved labels
|
||||||
@ -75,3 +77,21 @@ func ReleaseLabel(label string) error {
|
|||||||
// can be used to set duplicate labels on future container processes
|
// can be used to set duplicate labels on future container processes
|
||||||
// Deprecated: use selinux.DupSecOpt
|
// Deprecated: use selinux.DupSecOpt
|
||||||
var DupSecOpt = selinux.DupSecOpt
|
var DupSecOpt = selinux.DupSecOpt
|
||||||
|
|
||||||
|
// FormatMountLabel returns a string to be used by the mount command.
|
||||||
|
// The format of this string will be used to alter the labeling of the mountpoint.
|
||||||
|
// The string returned is suitable to be used as the options field of the mount command.
|
||||||
|
// If you need to have additional mount point options, you can pass them in as
|
||||||
|
// the first parameter. Second parameter is the label that you wish to apply
|
||||||
|
// to all content in the mount point.
|
||||||
|
func FormatMountLabel(src, mountLabel string) string {
|
||||||
|
if mountLabel != "" {
|
||||||
|
switch src {
|
||||||
|
case "":
|
||||||
|
src = fmt.Sprintf("context=%q", mountLabel)
|
||||||
|
default:
|
||||||
|
src = fmt.Sprintf("%s,context=%q", src, mountLabel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return src
|
||||||
|
}
|
||||||
|
34
vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go
generated
vendored
34
vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go
generated
vendored
@ -3,7 +3,6 @@
|
|||||||
package label
|
package label
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"strings"
|
"strings"
|
||||||
@ -43,7 +42,7 @@ func InitLabels(options []string) (plabel string, mlabel string, Err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", err
|
return "", "", err
|
||||||
}
|
}
|
||||||
|
mcsLevel := pcon["level"]
|
||||||
mcon, err := selinux.NewContext(mountLabel)
|
mcon, err := selinux.NewContext(mountLabel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", err
|
return "", "", err
|
||||||
@ -62,16 +61,21 @@ func InitLabels(options []string) (plabel string, mlabel string, Err error) {
|
|||||||
}
|
}
|
||||||
if con[0] == "filetype" {
|
if con[0] == "filetype" {
|
||||||
mcon["type"] = con[1]
|
mcon["type"] = con[1]
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
pcon[con[0]] = con[1]
|
pcon[con[0]] = con[1]
|
||||||
if con[0] == "level" || con[0] == "user" {
|
if con[0] == "level" || con[0] == "user" {
|
||||||
mcon[con[0]] = con[1]
|
mcon[con[0]] = con[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
selinux.ReleaseLabel(processLabel)
|
if pcon.Get() != processLabel {
|
||||||
processLabel = pcon.Get()
|
if pcon["level"] != mcsLevel {
|
||||||
mountLabel = mcon.Get()
|
selinux.ReleaseLabel(processLabel)
|
||||||
selinux.ReserveLabel(processLabel)
|
}
|
||||||
|
processLabel = pcon.Get()
|
||||||
|
mountLabel = mcon.Get()
|
||||||
|
selinux.ReserveLabel(processLabel)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return processLabel, mountLabel, nil
|
return processLabel, mountLabel, nil
|
||||||
}
|
}
|
||||||
@ -82,24 +86,6 @@ func GenLabels(options string) (string, string, error) {
|
|||||||
return InitLabels(strings.Fields(options))
|
return InitLabels(strings.Fields(options))
|
||||||
}
|
}
|
||||||
|
|
||||||
// FormatMountLabel returns a string to be used by the mount command.
|
|
||||||
// The format of this string will be used to alter the labeling of the mountpoint.
|
|
||||||
// The string returned is suitable to be used as the options field of the mount command.
|
|
||||||
// If you need to have additional mount point options, you can pass them in as
|
|
||||||
// the first parameter. Second parameter is the label that you wish to apply
|
|
||||||
// to all content in the mount point.
|
|
||||||
func FormatMountLabel(src, mountLabel string) string {
|
|
||||||
if mountLabel != "" {
|
|
||||||
switch src {
|
|
||||||
case "":
|
|
||||||
src = fmt.Sprintf("context=%q", mountLabel)
|
|
||||||
default:
|
|
||||||
src = fmt.Sprintf("%s,context=%q", src, mountLabel)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return src
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetFileLabel modifies the "path" label to the specified file label
|
// SetFileLabel modifies the "path" label to the specified file label
|
||||||
func SetFileLabel(path string, fileLabel string) error {
|
func SetFileLabel(path string, fileLabel string) error {
|
||||||
if !selinux.GetEnabled() || fileLabel == "" {
|
if !selinux.GetEnabled() || fileLabel == "" {
|
||||||
|
4
vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go
generated
vendored
4
vendor/github.com/opencontainers/selinux/go-selinux/label/label_stub.go
generated
vendored
@ -15,10 +15,6 @@ func GenLabels(options string) (string, string, error) {
|
|||||||
return "", "", nil
|
return "", "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func FormatMountLabel(src string, mountLabel string) string {
|
|
||||||
return src
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetFileLabel(path string, fileLabel string) error {
|
func SetFileLabel(path string, fileLabel string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user