rclone/backend/local
Nick Craig-Wood 01ccf204f4 local: fix permission and ownership on symlinks with --links and --metadata
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
2024-11-14 16:20:18 +00:00
..
about_unix.go build: fix linting issues reported by running golangci-lint with different GOOS 2024-04-22 19:29:12 +02:00
about_windows.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
clone_darwin.go local: fix --copy-links on macOS when cloning 2024-09-20 17:43:52 +01:00
fadvise_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
fadvise_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
lchmod.go local: fix permission and ownership on symlinks with --links and --metadata 2024-11-14 16:20:18 +00:00
lchmod_unix.go local: fix permission and ownership on symlinks with --links and --metadata 2024-11-14 16:20:18 +00:00
lchtimes.go local: fix permission and ownership on symlinks with --links and --metadata 2024-11-14 16:20:18 +00:00
lchtimes_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
lchtimes_windows.go local: fix permission and ownership on symlinks with --links and --metadata 2024-11-14 16:20:18 +00:00
local.go local: --local-no-clone flag to disable cloning for server-side copies 2024-08-15 15:36:38 +01:00
local_internal_test.go local: fix permission and ownership on symlinks with --links and --metadata 2024-11-14 16:20:18 +00:00
local_test.go backend: allow wrapping backend tests to run in make quicktest 2022-06-29 17:30:37 +01:00
metadata.go local: fix permission and ownership on symlinks with --links and --metadata 2024-11-14 16:20:18 +00:00
metadata_bsd.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
metadata_linux.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
metadata_other.go build: fix linting issues reported by running golangci-lint with different GOOS 2024-04-22 19:29:12 +02:00
metadata_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
metadata_windows.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
read_device_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
read_device_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
remove_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
remove_test.go Replace deprecated ioutil 2022-11-07 11:41:47 +00:00
remove_windows.go build: fix linting issues reported by golangci-lint on windows 2024-04-22 19:29:12 +02:00
setbtime.go local: fix permission and ownership on symlinks with --links and --metadata 2024-11-14 16:20:18 +00:00
setbtime_windows.go local: fix permission and ownership on symlinks with --links and --metadata 2024-11-14 16:20:18 +00:00
symlink.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
symlink_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
tests_test.go local: refactor default os encoding out from local backend into shared encoder lib 2021-08-19 20:14:50 +02:00
xattr.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
xattr_unsupported.go build: fix linting issues reported by running golangci-lint with different GOOS 2024-04-22 19:29:12 +02:00