Commit 193e2ae1 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #36386 from sjenning/fix-secret-file-mode

Automatic merge from submit-queue Avoid setting S_ISGID on files in volumes Some applications are having issues with setting the S_ISGID bit on files in volumes. We intend to do this for directories so that the group ID is inherited, but not files for which S_ISGID indicates madatory file locking https://linux.die.net/man/2/stat xref https://bugzilla.redhat.com/show_bug.cgi?id=1387306 @ncdc @derekwaynecarr @pmorie
parents 6b9ce1b4 67f31342
......@@ -71,7 +71,11 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64) error {
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 {
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