forked from TrueCloudLab/rclone
vfs: Add link permissions
This commit is contained in:
parent
126f00882b
commit
353bc3130e
1 changed files with 10 additions and 0 deletions
|
@ -100,6 +100,11 @@ var OptionsInfo = fs.Options{{
|
||||||
Default: FileMode(0666),
|
Default: FileMode(0666),
|
||||||
Help: "File permissions",
|
Help: "File permissions",
|
||||||
Groups: "VFS",
|
Groups: "VFS",
|
||||||
|
}, {
|
||||||
|
Name: "link_perms",
|
||||||
|
Default: FileMode(0666),
|
||||||
|
Help: "Link permissions",
|
||||||
|
Groups: "VFS",
|
||||||
}, {
|
}, {
|
||||||
Name: "vfs_case_insensitive",
|
Name: "vfs_case_insensitive",
|
||||||
Default: runtime.GOOS == "windows" || runtime.GOOS == "darwin", // default to true on Windows and Mac, false otherwise,
|
Default: runtime.GOOS == "windows" || runtime.GOOS == "darwin", // default to true on Windows and Mac, false otherwise,
|
||||||
|
@ -181,6 +186,7 @@ type Options struct {
|
||||||
GID uint32 `config:"gid"`
|
GID uint32 `config:"gid"`
|
||||||
DirPerms FileMode `config:"dir_perms"`
|
DirPerms FileMode `config:"dir_perms"`
|
||||||
FilePerms FileMode `config:"file_perms"`
|
FilePerms FileMode `config:"file_perms"`
|
||||||
|
LinkPerms FileMode `config:"link_perms"`
|
||||||
ChunkSize fs.SizeSuffix `config:"vfs_read_chunk_size"` // if > 0 read files in chunks
|
ChunkSize fs.SizeSuffix `config:"vfs_read_chunk_size"` // if > 0 read files in chunks
|
||||||
ChunkSizeLimit fs.SizeSuffix `config:"vfs_read_chunk_size_limit"` // if > ChunkSize double the chunk size after each chunk until reached
|
ChunkSizeLimit fs.SizeSuffix `config:"vfs_read_chunk_size_limit"` // if > ChunkSize double the chunk size after each chunk until reached
|
||||||
ChunkStreams int `config:"vfs_read_chunk_streams"` // Number of download streams to use
|
ChunkStreams int `config:"vfs_read_chunk_streams"` // Number of download streams to use
|
||||||
|
@ -208,7 +214,11 @@ func (opt *Options) Init() {
|
||||||
// Mask the permissions with the umask
|
// Mask the permissions with the umask
|
||||||
opt.DirPerms &= ^opt.Umask
|
opt.DirPerms &= ^opt.Umask
|
||||||
opt.FilePerms &= ^opt.Umask
|
opt.FilePerms &= ^opt.Umask
|
||||||
|
opt.LinkPerms &= ^opt.Umask
|
||||||
|
|
||||||
// Make sure directories are returned as directories
|
// Make sure directories are returned as directories
|
||||||
opt.DirPerms |= FileMode(os.ModeDir)
|
opt.DirPerms |= FileMode(os.ModeDir)
|
||||||
|
|
||||||
|
// Make sure links are returned as links
|
||||||
|
opt.LinkPerms |= FileMode(os.ModeSymlink)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue