fix(deps): update github.com/docker/go-plugins-helpers digest to 45e2431

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-08-01 04:17:44 +00:00
committed by GitHub
parent 737c08224e
commit f446f59d71
10 changed files with 20 additions and 30 deletions

View File

@ -2,7 +2,6 @@ package sdk
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
)
@ -50,7 +49,7 @@ func writeSpecFile(name, address, pluginSpecDir string, proto protocol) (string,
specFileDir := filepath.Join(pluginSpecDir, name+".spec")
url := string(proto) + "://" + address
if err := ioutil.WriteFile(specFileDir, []byte(url), 0644); err != nil {
if err := os.WriteFile(specFileDir, []byte(url), 0644); err != nil {
return "", err
}

View File

@ -1,4 +1,4 @@
// +build linux freebsd
//go:build linux || freebsd
package sdk

View File

@ -1,10 +1,10 @@
// +build linux freebsd
// +build nosystemd
//go:build (linux || freebsd) && nosystemd
package sdk
import "net"
// FIXME(thaJeztah): this code was added in https://github.com/docker/go-plugins-helpers/commit/008703b825c10311af1840deeaf5f4769df7b59e, but is not used anywhere
func setupSocketActivation() (net.Listener, error) {
return nil, nil
}

View File

@ -1,5 +1,4 @@
// +build linux freebsd
// +build !nosystemd
//go:build (linux || freebsd) && !nosystemd
package sdk
@ -25,6 +24,7 @@ func isRunningSystemd() bool {
return fi.IsDir()
}
// FIXME(thaJeztah): this code was added in https://github.com/docker/go-plugins-helpers/commit/008703b825c10311af1840deeaf5f4769df7b59e, but is not used anywhere
func setupSocketActivation() (net.Listener, error) {
if !isRunningSystemd() {
return nil, nil

View File

@ -1,4 +1,4 @@
// +build !linux,!freebsd
//go:build !linux && !freebsd
package sdk
@ -7,10 +7,6 @@ import (
"net"
)
var (
errOnlySupportedOnLinuxAndFreeBSD = errors.New("unix socket creation is only supported on Linux and FreeBSD")
)
func newUnixListener(pluginName string, gid int) (net.Listener, string, error) {
return nil, "", errOnlySupportedOnLinuxAndFreeBSD
return nil, "", errors.New("unix socket creation is only supported on Linux and FreeBSD")
}

View File

@ -1,4 +1,4 @@
// +build windows
//go:build windows
package sdk
@ -14,20 +14,19 @@ import (
// Named pipes use Windows Security Descriptor Definition Language to define ACL. Following are
// some useful definitions.
const (
// This will set permissions for everyone to have full access
// AllowEveryone grants full access permissions for everyone.
AllowEveryone = "S:(ML;;NW;;;LW)D:(A;;0x12019f;;;WD)"
// This will set permissions for Service, System, Adminstrator group and account to have full access
// AllowServiceSystemAdmin grants full access permissions for Service, System, Administrator group and account.
AllowServiceSystemAdmin = "D:(A;ID;FA;;;SY)(A;ID;FA;;;BA)(A;ID;FA;;;LA)(A;ID;FA;;;LS)"
)
func newWindowsListener(address, pluginName, daemonRoot string, pipeConfig *WindowsPipeConfig) (net.Listener, string, error) {
winioPipeConfig := winio.PipeConfig{
listener, err := winio.ListenPipe(address, &winio.PipeConfig{
SecurityDescriptor: pipeConfig.SecurityDescriptor,
InputBufferSize: pipeConfig.InBufferSize,
OutputBufferSize: pipeConfig.OutBufferSize,
}
listener, err := winio.ListenPipe(address, &winioPipeConfig)
})
if err != nil {
return nil, "", err
}
@ -48,7 +47,7 @@ func newWindowsListener(address, pluginName, daemonRoot string, pipeConfig *Wind
func windowsCreateDirectoryWithACL(name string) error {
sa := syscall.SecurityAttributes{Length: 0}
sddl := "D:P(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)"
const sddl = "D:P(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)"
sd, err := winio.SddlToSecurityDescriptor(sddl)
if err != nil {
return &os.PathError{Op: "mkdir", Path: name, Err: err}

View File

@ -1,4 +1,4 @@
// +build !windows
//go:build !windows
package sdk
@ -7,12 +7,8 @@ import (
"net"
)
var (
errOnlySupportedOnWindows = errors.New("named pipe creation is only supported on Windows")
)
func newWindowsListener(address, pluginName, daemonRoot string, pipeConfig *WindowsPipeConfig) (net.Listener, string, error) {
return nil, "", errOnlySupportedOnWindows
return nil, "", errors.New("named pipe creation is only supported on Windows")
}
func windowsCreateDirectoryWithACL(name string) error {