Commit 67f31342 authored by Seth Jennings's avatar Seth Jennings

Avoid setting S_ISGID on files in volumes.

Directories in volumes are set S_ISGID to ensure files created inside them inherit group ownership. Currently, files are also set S_ISGID however this is not relevant to the original intent, and indicates 'mandatory file locking' (stat(2)). With this commit, only directories are set S_ISGID.
parent dbc4121e
...@@ -71,7 +71,11 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64) error { ...@@ -71,7 +71,11 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64) error {
mask = roMask mask = roMask
} }
err = chmodRunner.Chmod(path, info.Mode()|mask|os.ModeSetgid) if info.IsDir() {
mask |= os.ModeSetgid
}
err = chmodRunner.Chmod(path, info.Mode()|mask)
if err != nil { if err != nil {
glog.Errorf("Chmod failed on %v: %v", path, err) glog.Errorf("Chmod failed on %v: %v", path, err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment