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/containernetworking/plugins 1fb94a4222eafc6f948eacdca9c9f2158b427e53
github.com/containers/image c6e0eee0f8eb38e78ae2e44a9aeea0576f451617 github.com/containers/image c6e0eee0f8eb38e78ae2e44a9aeea0576f451617
github.com/containers/storage 8b1a0f8d6863cf05709af333b8997a437652ec4c github.com/containers/storage 8b1a0f8d6863cf05709af333b8997a437652ec4c
github.com/containers/psgo 59a9dad536216e91da1861c9fbba75b85da84dcd github.com/containers/psgo dd34e7e448e5d4f3c7ce87b5da7738b00778dbfd
github.com/coreos/go-systemd v14 github.com/coreos/go-systemd v14
github.com/cri-o/ocicni master github.com/cri-o/ocicni master
github.com/cyphar/filepath-securejoin v0.2.1 github.com/cyphar/filepath-securejoin v0.2.1

View File

@ -4,13 +4,13 @@ import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"os/user"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"time" "time"
"github.com/opencontainers/runc/libcontainer/user"
"github.com/pkg/errors" "github.com/pkg/errors"
"golang.org/x/sys/unix" "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 // lookupGID returns the textual group ID, if it can be optained, or the
// decimal input representation otherwise. // decimal input representation otherwise.
func lookupGID(gid string) (string, error) { func lookupGID(gid string) (string, error) {
if gid == "0" { gidNum, err := strconv.Atoi(gid)
return "root", nil
}
g, err := user.LookupGroupId(gid)
if err != nil { if err != nil {
switch err.(type) { return "", errors.Wrap(err, "error parsing group ID")
case user.UnknownGroupIdError: }
return gid, nil g, err := user.LookupGid(gidNum)
default: if err != nil {
return "", err return gid, nil
}
} }
return g.Name, 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 // lookupUID return the textual user ID, if it can be optained, or the decimal
// input representation otherwise. // input representation otherwise.
func lookupUID(uid string) (string, error) { func lookupUID(uid string) (string, error) {
if uid == "0" { uidNum, err := strconv.Atoi(uid)
return "root", nil
}
u, err := user.LookupId(uid)
if err != nil { if err != nil {
switch err.(type) { return "", errors.Wrap(err, "error parsing user ID")
case user.UnknownUserError:
return uid, nil
default:
return "", err
}
} }
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/davecgh/go-spew master
github.com/opencontainers/runc master
github.com/pkg/errors master github.com/pkg/errors master
github.com/pmezard/go-difflib master github.com/pmezard/go-difflib master
github.com/sirupsen/logrus master github.com/sirupsen/logrus master