Merge pull request #73533 from babiel/fix-fsgroup-directory-permissions

Ensure directories are executable for fsGroup
pull/564/head
Kubernetes Prow Robot 2019-02-06 20:03:01 -08:00 committed by GitHub
commit 6fc9a72f58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -28,8 +28,9 @@ import (
)
const (
rwMask = os.FileMode(0660)
roMask = os.FileMode(0440)
rwMask = os.FileMode(0660)
roMask = os.FileMode(0440)
execMask = os.FileMode(0110)
)
// SetVolumeOwnership modifies the given volume to be owned by
@ -79,6 +80,7 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64) error {
if info.IsDir() {
mask |= os.ModeSetgid
mask |= execMask
}
err = os.Chmod(path, info.Mode()|mask)