Sockets interface has been updated to take in a the group
id as an integer rather than a string.
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
... | ... |
@@ -31,7 +31,12 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) ([]net.Listene |
31 | 31 |
} |
32 | 32 |
ls = append(ls, l) |
33 | 33 |
case "unix": |
34 |
- l, err := sockets.NewUnixSocket(addr, socketGroup) |
|
34 |
+ |
|
35 |
+ gid, err := strconv.Atoi(socketGroup) |
|
36 |
+ if err != nil { |
|
37 |
+ return nil, fmt.Errorf("failed to parse socket group id: should be a number: %v", socketGroup) |
|
38 |
+ } |
|
39 |
+ l, err := sockets.NewUnixSocket(addr, gid) |
|
35 | 40 |
if err != nil { |
36 | 41 |
return nil, fmt.Errorf("can't create unix socket %s: %v", addr, err) |
37 | 42 |
} |