mirror of
https://github.com/rclone/rclone.git
synced 2024-12-19 17:34:05 +08:00
01ccf204f4
Before this change, if writing to a local backend with --metadata and --links, if the incoming metadata contained mode or ownership information then rclone would apply the mode/ownership to the destination of the link not the link itself. This fixes the problem by using the link safe sycall variants lchown/fchmodat when --links and --metadata is in use. Note that Linux does not support setting permissions on symlinks, so rclone emits a debug message in this case. This also fixes setting times on symlinks on Windows which wasn't implemented for atime, mtime and was incorrectly setting the target of the symlink for btime. See: https://github.com/rclone/rclone/security/advisories/GHSA-hrxh-9w67-g4cv
22 lines
367 B
Go
22 lines
367 B
Go
//go:build !windows
|
|
|
|
package local
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
const haveSetBTime = false
|
|
|
|
// setBTime changes the birth time of the file passed in
|
|
func setBTime(name string, btime time.Time) error {
|
|
// Does nothing
|
|
return nil
|
|
}
|
|
|
|
// lsetBTime changes the birth time of the link passed in
|
|
func lsetBTime(name string, btime time.Time) error {
|
|
// Does nothing
|
|
return nil
|
|
}
|