mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Don't error with empty group
Don't error if no group is specified, as this was the prior API. Also don't return a docker specific error message as this is in `/pkg` and used by other projects. Just set the default group for the current user/group consuming the package. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
e1101b1295
commit
169c013911
2 changed files with 10 additions and 6 deletions
|
@ -22,10 +22,12 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) (ls []net.List
|
||||||
case "unix":
|
case "unix":
|
||||||
gid, err := lookupGID(socketGroup)
|
gid, err := lookupGID(socketGroup)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if socketGroup != defaultSocketGroup {
|
if socketGroup != "" {
|
||||||
return nil, err
|
if socketGroup != defaultSocketGroup {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err)
|
||||||
}
|
}
|
||||||
logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err)
|
|
||||||
gid = os.Getgid()
|
gid = os.Getgid()
|
||||||
}
|
}
|
||||||
l, err := sockets.NewUnixSocket(addr, gid)
|
l, err := sockets.NewUnixSocket(addr, gid)
|
||||||
|
|
|
@ -35,10 +35,12 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) ([]net.Listene
|
||||||
case "unix":
|
case "unix":
|
||||||
gid, err := lookupGID(socketGroup)
|
gid, err := lookupGID(socketGroup)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if socketGroup != defaultSocketGroup {
|
if socketGroup != "" {
|
||||||
return nil, err
|
if socketGroup != defaultSocketGroup {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err)
|
||||||
}
|
}
|
||||||
logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err)
|
|
||||||
gid = os.Getgid()
|
gid = os.Getgid()
|
||||||
}
|
}
|
||||||
l, err := sockets.NewUnixSocket(addr, gid)
|
l, err := sockets.NewUnixSocket(addr, gid)
|
||||||
|
|
Loading…
Add table
Reference in a new issue