Skip to content

Commit

Permalink
fix(mount): creating directory with 0755 permission
Browse files Browse the repository at this point in the history
Signed-off-by: Pawan <pawan@mayadata.io>
  • Loading branch information
pawanpraka1 committed Dec 17, 2020
1 parent 48e6a19 commit 0e8db53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/zfs/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ func MountDataset(vol *apis.ZFSVolume, mount *MountInfo) error {

// MountFilesystem mounts the disk to the specified path
func MountFilesystem(vol *apis.ZFSVolume, mount *MountInfo) error {
if err := os.MkdirAll(mount.MountPath, 0000); err != nil {
if err := os.MkdirAll(mount.MountPath, 0755); err != nil {
return status.Errorf(codes.Internal, "Could not create dir {%q}, err: %v", mount.MountPath, err)
}

// in case if the dir already exists, above call returns nil
// so permission needs to be updated
if err := os.Chmod(mount.MountPath, 0000); err != nil {
if err := os.Chmod(mount.MountPath, 0755); err != nil {
return status.Errorf(codes.Internal, "Could not change mode of dir {%q}, err: %v", mount.MountPath, err)
}

Expand Down

0 comments on commit 0e8db53

Please sign in to comment.