diff options
| author | Daniel Santos <danlsgiga@gmail.com> | 2021-01-26 20:42:10 -0700 |
|---|---|---|
| committer | Daniel Santos <danlsgiga@gmail.com> | 2021-01-26 20:42:10 -0700 |
| commit | 5a761bb7a4a2d9a9e41a089b5091d674b4ff3297 (patch) | |
| tree | b72300c82412e2bac4ff4d99a9ecc221eb81528b | |
| parent | ad2a20c8a5827461d07ab2a46932d0c1c89d1b37 (diff) | |
| download | seaweedfs-5a761bb7a4a2d9a9e41a089b5091d674b4ff3297.tar.xz seaweedfs-5a761bb7a4a2d9a9e41a089b5091d674b4ff3297.zip | |
Enforce umask correctly
| -rw-r--r-- | weed/command/mount_std.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index eaa66519e..fe9ba28c4 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -100,7 +100,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { uid, gid := uint32(0), uint32(0) mountMode := os.ModeDir | 0777 if err == nil { - mountMode = os.ModeDir | fileInfo.Mode() + mountMode := os.ModeDir | os.FileMode(0777)&^umask uid, gid = util.GetFileUidGid(fileInfo) fmt.Printf("mount point owner uid=%d gid=%d mode=%s\n", uid, gid, fileInfo.Mode()) } else { @@ -208,9 +208,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { }) glog.V(0).Infof("mounted %s%s to %s", filer, mountRoot, dir) - server := fs.New(c, nil) - seaweedFileSystem.Server = server - err = server.Serve(seaweedFileSystem) + err = fs.Serve(c, seaweedFileSystem) // check if the mount process has an error to report <-c.Ready |
