mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 08:58:26 +08:00
local: fix incorrect conversion between integer types
Some checks failed
Docker beta build / Build image job (push) Has been cancelled
Some checks failed
Docker beta build / Build image job (push) Has been cancelled
This commit is contained in:
parent
c8366dfef3
commit
4e708e59f2
|
@ -129,10 +129,13 @@ func (o *Object) writeMetadataToFile(m fs.Metadata) (outErr error) {
|
|||
}
|
||||
mode, hasMode := o.parseMetadataInt(m, "mode", 8)
|
||||
if hasMode {
|
||||
if mode >= 0 && uint(mode) <= math.MaxUint32 {
|
||||
err = os.Chmod(o.path, os.FileMode(mode))
|
||||
if err != nil {
|
||||
outErr = fmt.Errorf("failed to change permissions: %w", err)
|
||||
if mode >= 0 {
|
||||
umode := uint(mode)
|
||||
if umode <= math.MaxUint32 {
|
||||
err = os.Chmod(o.path, os.FileMode(umode))
|
||||
if err != nil {
|
||||
outErr = fmt.Errorf("failed to change permissions: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user