From 59e91e9c7eacbafa3bcdc835eb7b78395210a082 Mon Sep 17 00:00:00 2001 From: limd Date: Thu, 24 Sep 2020 10:25:45 +0800 Subject: [PATCH] mount: fix k8s pvc mount directory permission --- weed/command/mount_std.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index e84eebada..cbac35351 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -12,7 +12,6 @@ import ( "runtime" "strconv" "strings" - "syscall" "time" "github.com/seaweedfs/fuse" @@ -92,9 +91,8 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { // detect mount folder mode if *option.dirAutoCreate { - oldMask := syscall.Umask(0) - os.MkdirAll(dir, os.ModePerm&^umask) - syscall.Umask(oldMask) + os.MkdirAll(dir, os.FileMode(0777)&^umask) + os.Chmod(dir, os.FileMode(0777)&^umask) } mountMode := os.ModeDir | 0777 fileInfo, err := os.Stat(dir)