mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 01:18:37 +08:00
mount: just set default options without checking if customized by user, because it will be overridden anyway
This commit is contained in:
parent
07c40780b3
commit
e3191d096f
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user