summaryrefslogtreecommitdiff
path: root/vendor/github.com
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-07-20 12:34:51 -0400
committerMatthew Heon <mheon@redhat.com>2018-07-20 12:34:51 -0400
commit17b1764fb81199b5ab95799ed028675d2501fdc9 (patch)
tree397451ca4b19e943bf9a46753210b19311886547 /vendor/github.com
parent7944bca4681893971ad6bda4ade4e1b3470b9559 (diff)
downloadpodman-17b1764fb81199b5ab95799ed028675d2501fdc9.tar.gz
podman-17b1764fb81199b5ab95799ed028675d2501fdc9.tar.bz2
podman-17b1764fb81199b5ab95799ed028675d2501fdc9.zip
Update psgo vendor
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/containers/psgo/ps/ps.go32
-rw-r--r--vendor/github.com/containers/psgo/vendor.conf1
2 files changed, 13 insertions, 20 deletions
diff --git a/vendor/github.com/containers/psgo/ps/ps.go b/vendor/github.com/containers/psgo/ps/ps.go
index a7e7cafad..b954988e5 100644
--- a/vendor/github.com/containers/psgo/ps/ps.go
+++ b/vendor/github.com/containers/psgo/ps/ps.go
@@ -4,13 +4,13 @@ import (
"fmt"
"io/ioutil"
"os"
- "os/user"
"runtime"
"strconv"
"strings"
"sync"
"time"
+ "github.com/opencontainers/runc/libcontainer/user"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)
@@ -405,17 +405,13 @@ func parseDescriptors(input string) ([]aixFormatDescriptor, error) {
// lookupGID returns the textual group ID, if it can be optained, or the
// decimal input representation otherwise.
func lookupGID(gid string) (string, error) {
- if gid == "0" {
- return "root", nil
+ gidNum, err := strconv.Atoi(gid)
+ if err != nil {
+ return "", errors.Wrap(err, "error parsing group ID")
}
- g, err := user.LookupGroupId(gid)
+ g, err := user.LookupGid(gidNum)
if err != nil {
- switch err.(type) {
- case user.UnknownGroupIdError:
- return gid, nil
- default:
- return "", err
- }
+ return gid, nil
}
return g.Name, nil
}
@@ -442,19 +438,15 @@ func processPPID(p *process) (string, error) {
// lookupUID return the textual user ID, if it can be optained, or the decimal
// input representation otherwise.
func lookupUID(uid string) (string, error) {
- if uid == "0" {
- return "root", nil
+ uidNum, err := strconv.Atoi(uid)
+ if err != nil {
+ return "", errors.Wrap(err, "error parsing user ID")
}
- u, err := user.LookupId(uid)
+ u, err := user.LookupUid(uidNum)
if err != nil {
- switch err.(type) {
- case user.UnknownUserError:
- return uid, nil
- default:
- return "", err
- }
+ return uid, nil
}
- return u.Username, nil
+ return u.Name, nil
}
diff --git a/vendor/github.com/containers/psgo/vendor.conf b/vendor/github.com/containers/psgo/vendor.conf
index ebdb065ef..1fba46ec1 100644
--- a/vendor/github.com/containers/psgo/vendor.conf
+++ b/vendor/github.com/containers/psgo/vendor.conf
@@ -1,4 +1,5 @@
github.com/davecgh/go-spew master
+github.com/opencontainers/runc master
github.com/pkg/errors master
github.com/pmezard/go-difflib master
github.com/sirupsen/logrus master