From e778a44c1591c2c3de866447d2798538ca2146b3 Mon Sep 17 00:00:00 2001 From: zhijian Date: Thu, 19 Sep 2024 18:40:34 +0800 Subject: [PATCH] cmd/sync:skip the permission copy when the src is a symlink and `--links` is enabled --- pkg/sync/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sync/sync.go b/pkg/sync/sync.go index ab297cb73ce6..398f30cab157 100644 --- a/pkg/sync/sync.go +++ b/pkg/sync/sync.go @@ -642,7 +642,7 @@ func worker(tasks <-chan object.Object, src, dst object.ObjectStorage, config *C } else if equal { if config.DeleteSrc { deleteObj(src, key, false) - } else if config.Perms { + } else if config.Perms && (!obj.IsSymlink() || !config.Links) { if o, e := dst.Head(key); e == nil { if needCopyPerms(obj, o) { copyPerms(dst, obj, config)