kompose/vendor/golang.org/x/sys/unix/openbsd_pledge.go
Charlie Drage 43b1ca0fe0 Resolve logrus and gojsonschema vendoring conflicts
Some vendoring is blocking other PR's due to changes to logrus (Sirupsen
vs sirupsen for lower-case) as well as a non-versioned gojsonschema in
glide.yaml

This updates glide.yaml to reflect the upper-case as well as lower-case
versions of logrus as well as adds a versionized gojsonschema in order
to get rid of the following error:

```sh
▶ make bin
go build -ldflags="-w -X github.com/kubernetes/kompose/cmd.GITCOMMIT=0e56b7d" -o kompose main.go
vendor/github.com/docker/cli/cli/compose/schema/schema.go:34: cannot use portsFormatChecker literal (type portsFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
        portsFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
                have IsFormat(string) bool
                want IsFormat(interface {}) bool
vendor/github.com/docker/cli/cli/compose/schema/schema.go:35: cannot use portsFormatChecker literal (type portsFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
        portsFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
                have IsFormat(string) bool
                want IsFormat(interface {}) bool
vendor/github.com/docker/cli/cli/compose/schema/schema.go:36: cannot use durationFormatChecker literal (type durationFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
        durationFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
                have IsFormat(string) bool
                want IsFormat(interface {}) bool
vendor/github.com/docker/libcompose/config/schema_helpers.go:60: cannot use environmentFormatChecker literal (type environmentFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
        environmentFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
                have IsFormat(string) bool
                want IsFormat(interface {}) bool
vendor/github.com/docker/libcompose/config/schema_helpers.go:61: cannot use portsFormatChecker literal (type portsFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
        portsFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
                have IsFormat(string) bool
                want IsFormat(interface {}) bool
vendor/github.com/docker/libcompose/config/schema_helpers.go:62: cannot use portsFormatChecker literal (type portsFormatChecker) as type gojsonschema.FormatChecker in argument to gojsonschema.FormatCheckers.Add:
        portsFormatChecker does not implement gojsonschema.FormatChecker (wrong type for IsFormat method)
                have IsFormat(string) bool
                want IsFormat(interface {}) bool
^CMakefile:29: recipe for target 'bin' failed
make: *** [bin] Interrupt
```
2017-10-02 11:29:18 -04:00

39 lines
889 B
Go

// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build openbsd
// +build 386 amd64 arm
package unix
import (
"syscall"
"unsafe"
)
const (
SYS_PLEDGE = 108
)
// Pledge implements the pledge syscall. For more information see pledge(2).
func Pledge(promises string, paths []string) error {
promisesPtr, err := syscall.BytePtrFromString(promises)
if err != nil {
return err
}
promisesUnsafe, pathsUnsafe := unsafe.Pointer(promisesPtr), unsafe.Pointer(nil)
if paths != nil {
var pathsPtr []*byte
if pathsPtr, err = syscall.SlicePtrFromStrings(paths); err != nil {
return err
}
pathsUnsafe = unsafe.Pointer(&pathsPtr[0])
}
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0)
if e != 0 {
return e
}
return nil
}