Ensure grpc socket is group writable

Updates the filemode on the grpc socket to have group write
permission which is needed to perform GRPC. Additionally, ensure
the run directory has the specified group ownership and has group
read and enter permission.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan 2017-04-26 14:40:36 -07:00
parent 8f524ad42c
commit 4cb0839e41
2 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,12 @@ func platformInit(context *cli.Context) error {
return err
}
}
if err := os.MkdirAll(conf.State, 0750); err != nil {
return err
}
if err := os.Chown(conf.State, conf.GRPC.Uid, conf.GRPC.Gid); err != nil {
return err
}
return nil
}

View File

@ -28,6 +28,11 @@ func GetLocalListener(path string, uid, gid int) (net.Listener, error) {
return l, err
}
if err := os.Chmod(path, 0660); err != nil {
l.Close()
return nil, err
}
if err := os.Chown(path, uid, gid); err != nil {
l.Close()
return nil, err