bump gocapability
full diff: db04d3cc01...d98352740c
changes included:
- syndtr/gocapability#14 capability: Deprecate NewPid and NewFile for NewPid2 and NewFile2
- syndtr/gocapability#16 Fix capHeader.pid type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
b819d05fd0
commit
0fd02564a2
@ -38,7 +38,7 @@ github.com/Microsoft/hcsshim 8abdbb8205e4192c68b5f84c31197156f31be517
|
||||
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
|
||||
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
|
||||
github.com/containerd/ttrpc f02858b1457c5ca3aaec3a0803eb0d59f96e41d6
|
||||
github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
|
||||
github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2
|
||||
gotest.tools v2.3.0
|
||||
github.com/google/go-cmp v0.2.0
|
||||
go.etcd.io/bbolt v1.3.2
|
||||
|
71
vendor/github.com/syndtr/gocapability/capability/capability.go
generated
vendored
71
vendor/github.com/syndtr/gocapability/capability/capability.go
generated
vendored
@ -60,13 +60,74 @@ type Capabilities interface {
|
||||
Apply(kind CapType) error
|
||||
}
|
||||
|
||||
// NewPid create new initialized Capabilities object for given pid when it
|
||||
// is nonzero, or for the current pid if pid is 0
|
||||
// NewPid initializes a new Capabilities object for given pid when
|
||||
// it is nonzero, or for the current process if pid is 0.
|
||||
//
|
||||
// Deprecated: Replace with NewPid2. For example, replace:
|
||||
//
|
||||
// c, err := NewPid(0)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
// with:
|
||||
//
|
||||
// c, err := NewPid2(0)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// err = c.Load()
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
func NewPid(pid int) (Capabilities, error) {
|
||||
c, err := newPid(pid)
|
||||
if err != nil {
|
||||
return c, err
|
||||
}
|
||||
err = c.Load()
|
||||
return c, err
|
||||
}
|
||||
|
||||
// NewPid2 initializes a new Capabilities object for given pid when
|
||||
// it is nonzero, or for the current process if pid is 0. This
|
||||
// does not load the process's current capabilities; to do that you
|
||||
// must call Load explicitly.
|
||||
func NewPid2(pid int) (Capabilities, error) {
|
||||
return newPid(pid)
|
||||
}
|
||||
|
||||
// NewFile create new initialized Capabilities object for given named file.
|
||||
func NewFile(name string) (Capabilities, error) {
|
||||
return newFile(name)
|
||||
// NewFile initializes a new Capabilities object for given file path.
|
||||
//
|
||||
// Deprecated: Replace with NewFile2. For example, replace:
|
||||
//
|
||||
// c, err := NewFile(path)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
// with:
|
||||
//
|
||||
// c, err := NewFile2(path)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// err = c.Load()
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
func NewFile(path string) (Capabilities, error) {
|
||||
c, err := newFile(path)
|
||||
if err != nil {
|
||||
return c, err
|
||||
}
|
||||
err = c.Load()
|
||||
return c, err
|
||||
}
|
||||
|
||||
// NewFile2 creates a new initialized Capabilities object for given
|
||||
// file path. This does not load the process's current capabilities;
|
||||
// to do that you must call Load explicitly.
|
||||
func NewFile2(path string) (Capabilities, error) {
|
||||
return newFile(path)
|
||||
}
|
||||
|
12
vendor/github.com/syndtr/gocapability/capability/capability_linux.go
generated
vendored
12
vendor/github.com/syndtr/gocapability/capability/capability_linux.go
generated
vendored
@ -103,21 +103,17 @@ func newPid(pid int) (c Capabilities, err error) {
|
||||
case linuxCapVer1:
|
||||
p := new(capsV1)
|
||||
p.hdr.version = capVers
|
||||
p.hdr.pid = pid
|
||||
p.hdr.pid = int32(pid)
|
||||
c = p
|
||||
case linuxCapVer2, linuxCapVer3:
|
||||
p := new(capsV3)
|
||||
p.hdr.version = capVers
|
||||
p.hdr.pid = pid
|
||||
p.hdr.pid = int32(pid)
|
||||
c = p
|
||||
default:
|
||||
err = errUnknownVers
|
||||
return
|
||||
}
|
||||
err = c.Load()
|
||||
if err != nil {
|
||||
c = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -492,10 +488,6 @@ func (c *capsV3) Apply(kind CapType) (err error) {
|
||||
|
||||
func newFile(path string) (c Capabilities, err error) {
|
||||
c = &capsFile{path: path}
|
||||
err = c.Load()
|
||||
if err != nil {
|
||||
c = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
2
vendor/github.com/syndtr/gocapability/capability/syscall_linux.go
generated
vendored
2
vendor/github.com/syndtr/gocapability/capability/syscall_linux.go
generated
vendored
@ -13,7 +13,7 @@ import (
|
||||
|
||||
type capHeader struct {
|
||||
version uint32
|
||||
pid int
|
||||
pid int32
|
||||
}
|
||||
|
||||
type capData struct {
|
||||
|
Loading…
Reference in New Issue
Block a user