1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Correctly check that gid parses as an int

Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
This commit is contained in:
Aidan Hobson Sayers 2015-03-14 23:00:38 +00:00
parent 334382a8c3
commit 8ef79ae8e4

View file

@ -1458,7 +1458,7 @@ func lookupGidByName(nameOrGid string) (int, error) {
return groups[0].Gid, nil
}
gid, err := strconv.Atoi(nameOrGid)
if err != nil {
if err == nil {
log.Warnf("Could not find GID %d", gid)
return gid, nil
}