From e3191d096fbabbed51c55d26aed60ace4d2cde1d Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Sun, 15 Nov 2020 01:29:10 +0100 Subject: [PATCH] mount: just set default options without checking if customized by user, because it will be overridden anyway --- cmd/cmount/mount.go | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.go index 8029fca8a..ecfabe3f4 100644 --- a/cmd/cmount/mount.go +++ b/cmd/cmount/mount.go @@ -12,7 +12,6 @@ import ( "fmt" "os" "runtime" - "strings" "time" "github.com/billziss-gh/cgofuse/fuse" @@ -46,28 +45,9 @@ func mountOptions(VFS *vfs.VFS, device string, mountpoint string, opt *mountlib. options = append(options, "-o", "debug") } - // Determine if ExtraOptions already has an opt in - hasExtraOption := func(optionName string) bool { - optionName += "=" - for _, option := range opt.ExtraOptions { - suboptions := strings.Split(option, ",") - for _, suboption := range suboptions { - if strings.HasPrefix(suboption, optionName) { - return true - } - } - } - return false - } - if runtime.GOOS == "windows" { - // Setting uid and gid to -1 by default, which mean current user in WinFsp - if !hasExtraOption("uid") { - options = append(options, "-o", "uid=-1") - } - if !hasExtraOption("gid") { - options = append(options, "-o", "gid=-1") - } + options = append(options, "-o", "uid=-1") + options = append(options, "-o", "gid=-1") options = append(options, "--FileSystemName=rclone") if opt.VolumeName != "" { if opt.NetworkMode {