mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:54:44 +01:00
local: fix incorrect conversion between integer types
This commit is contained in:
parent
c8366dfef3
commit
4e708e59f2
@ -129,13 +129,16 @@ func (o *Object) writeMetadataToFile(m fs.Metadata) (outErr error) {
|
|||||||
}
|
}
|
||||||
mode, hasMode := o.parseMetadataInt(m, "mode", 8)
|
mode, hasMode := o.parseMetadataInt(m, "mode", 8)
|
||||||
if hasMode {
|
if hasMode {
|
||||||
if mode >= 0 && uint(mode) <= math.MaxUint32 {
|
if mode >= 0 {
|
||||||
err = os.Chmod(o.path, os.FileMode(mode))
|
umode := uint(mode)
|
||||||
|
if umode <= math.MaxUint32 {
|
||||||
|
err = os.Chmod(o.path, os.FileMode(umode))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
outErr = fmt.Errorf("failed to change permissions: %w", err)
|
outErr = fmt.Errorf("failed to change permissions: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// FIXME not parsing rdev yet
|
// FIXME not parsing rdev yet
|
||||||
return outErr
|
return outErr
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user