diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-08-17 06:28:45 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-08-21 10:56:29 -0400 |
commit | 3848cac86052369c35a76f86a1f8e5471dfdf9e2 (patch) | |
tree | ce349740b66871a766c7a98bc40333b32897baae /vendor/golang.org/x/sys/unix/syscall_bsd.go | |
parent | 516196f09677819b72d03e068fb8094b28e273aa (diff) | |
download | podman-3848cac86052369c35a76f86a1f8e5471dfdf9e2.tar.gz podman-3848cac86052369c35a76f86a1f8e5471dfdf9e2.tar.bz2 podman-3848cac86052369c35a76f86a1f8e5471dfdf9e2.zip |
In podman 1.* regression on --cap-add
In podman 1.0 if you executed a command like:
podman run --user dwalsh --cap-add net_bind_service alpine nc -l 80
It would work, and the user dwalsh would get the capability, in
podman 2.0, only root and the binding set gets the capability.
This change restores us back to the way podman 1.0 worked.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_bsd.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_bsd.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index 68605db62..60bbe10ad 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -527,6 +527,23 @@ func SysctlClockinfo(name string) (*Clockinfo, error) { return &ci, nil } +func SysctlTimeval(name string) (*Timeval, error) { + mib, err := sysctlmib(name) + if err != nil { + return nil, err + } + + var tv Timeval + n := uintptr(unsafe.Sizeof(tv)) + if err := sysctl(mib, (*byte)(unsafe.Pointer(&tv)), &n, nil, 0); err != nil { + return nil, err + } + if n != unsafe.Sizeof(tv) { + return nil, EIO + } + return &tv, nil +} + //sys utimes(path string, timeval *[2]Timeval) (err error) func Utimes(path string, tv []Timeval) error { |