Merge pull request #1121 from mheon/bump_psgo

Update psgo vendor
This commit is contained in:
Matthew Heon
2018-07-20 13:46:43 -04:00
committed by GitHub
3 changed files with 16 additions and 23 deletions

View File

@ -12,7 +12,7 @@ github.com/containernetworking/cni v0.7.0-alpha1
github.com/containernetworking/plugins 1fb94a4222eafc6f948eacdca9c9f2158b427e53
github.com/containers/image c6e0eee0f8eb38e78ae2e44a9aeea0576f451617
github.com/containers/storage 8b1a0f8d6863cf05709af333b8997a437652ec4c
github.com/containers/psgo 59a9dad536216e91da1861c9fbba75b85da84dcd
github.com/containers/psgo dd34e7e448e5d4f3c7ce87b5da7738b00778dbfd
github.com/coreos/go-systemd v14
github.com/cri-o/ocicni master
github.com/cyphar/filepath-securejoin v0.2.1

View File

@ -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
}
g, err := user.LookupGroupId(gid)
gidNum, err := strconv.Atoi(gid)
if err != nil {
switch err.(type) {
case user.UnknownGroupIdError:
return gid, nil
default:
return "", err
}
return "", errors.Wrap(err, "error parsing group ID")
}
g, err := user.LookupGid(gidNum)
if err != nil {
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
}
u, err := user.LookupId(uid)
uidNum, err := strconv.Atoi(uid)
if err != nil {
switch err.(type) {
case user.UnknownUserError:
return uid, nil
default:
return "", err
}
return "", errors.Wrap(err, "error parsing user ID")
}
return u.Username, nil
u, err := user.LookupUid(uidNum)
if err != nil {
return uid, nil
}
return u.Name, nil
}

View File

@ -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