serve/docker: fix octal umask
This commit is contained in:
parent
8b4a89d34b
commit
729704bcb8
1 changed files with 9 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package docker
|
package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/rclone/rclone/cmd/mountlib"
|
"github.com/rclone/rclone/cmd/mountlib"
|
||||||
|
@ -270,8 +271,14 @@ func getVFSOption(vfsOpt *vfscommon.Options, opt rc.Params, key string) (ok bool
|
||||||
|
|
||||||
// unprefixed unix-only vfs options
|
// unprefixed unix-only vfs options
|
||||||
case "umask":
|
case "umask":
|
||||||
intVal, err = opt.GetInt64(key)
|
// GetInt64 doesn't support the `0octal` umask syntax - parse locally
|
||||||
vfsOpt.Umask = int(intVal)
|
var strVal string
|
||||||
|
if strVal, err = opt.GetString(key); err == nil {
|
||||||
|
var longVal int64
|
||||||
|
if longVal, err = strconv.ParseInt(strVal, 0, 0); err == nil {
|
||||||
|
vfsOpt.Umask = int(longVal)
|
||||||
|
}
|
||||||
|
}
|
||||||
case "uid":
|
case "uid":
|
||||||
intVal, err = opt.GetInt64(key)
|
intVal, err = opt.GetInt64(key)
|
||||||
vfsOpt.UID = uint32(intVal)
|
vfsOpt.UID = uint32(intVal)
|
||||||
|
|
Loading…
Reference in a new issue