Skip to content

Commit

Permalink
ModeSetgid (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasasx authored Apr 12, 2023
1 parent d71f63f commit 999b3ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/lvm/lvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func mountLV(lvname, mountPath string, vgName string, fsType string) (string, er
}
}

err = os.MkdirAll(mountPath, 0777)
err = os.MkdirAll(mountPath, 0777|os.ModeSetgid)
if err != nil {
return string(out), fmt.Errorf("unable to create mount directory for lv:%s err:%w", lvname, err)
}
Expand All @@ -207,7 +207,7 @@ func mountLV(lvname, mountPath string, vgName string, fsType string) (string, er
return string(out), fmt.Errorf("unable to mount %s to %s err:%w output:%s", lvPath, mountPath, err, out)
}
}
err = os.Chmod(mountPath, 0777)
err = os.Chmod(mountPath, 0777|os.ModeSetgid)
if err != nil {
return "", fmt.Errorf("unable to change permissions of volume mount %s err:%w", mountPath, err)
}
Expand All @@ -234,7 +234,7 @@ func bindMountLV(lvname, mountPath string, vgName string) (string, error) {
return string(out), fmt.Errorf("unable to mount %s to %s err:%w output:%s", lvPath, mountPath, err, out)
}
}
err = os.Chmod(mountPath, 0777)
err = os.Chmod(mountPath, 0777|os.ModeSetgid)
if err != nil {
return "", fmt.Errorf("unable to change permissions of volume mount %s err:%w", mountPath, err)
}
Expand Down

0 comments on commit 999b3ee

Please sign in to comment.