Chown grpc socket based on config

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2017-03-08 11:42:36 -08:00
parent e1731d2e5e
commit fc45d9c119
2 changed files with 5 additions and 0 deletions

View file

@ -58,6 +58,8 @@ func (c *config) decodePlugin(name string, v interface{}) error {
type grpcConfig struct {
Socket string `toml:"socket"`
Uid int `toml:"uid"`
Gid int `toml:"gid"`
}
type debug struct {

View file

@ -330,6 +330,9 @@ func serveGRPC(server *grpc.Server) error {
if err != nil {
return err
}
if err := os.Chown(path, conf.GRPC.Uid, conf.GRPC.Gid); err != nil {
return err
}
go func() {
defer l.Close()
if err := server.Serve(l); err != nil {