From 1053d7e123f74d089178f04c1dac6b8c9dcafd53 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 8 Jun 2018 15:29:18 +0100 Subject: [PATCH] local: fix symlink/junction point directory handling under Windows Before this commit rclone's handling of symlinks and junction points under Windows was broken. rclone treated them as files and attempted to transfer them which gave the error "The handle is invalid". Ultimately the cause of this was 3e43ff7414b73f0d which was a workaround so files with reparse points (which are a kind of symlink) would transfer correctly. The solution implemented is to revert the above commit which will mean that #614 will break again. However there is now a work-around (which will be signaled by rclone) to use the -L flag which wasn't available when the original commit was made. Fixes #2336 --- backend/local/local.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/backend/local/local.go b/backend/local/local.go index d7e9bc346..aaff49a1c 100644 --- a/backend/local/local.go +++ b/backend/local/local.go @@ -642,11 +642,6 @@ func (o *Object) Storable() bool { } } mode := o.mode - // On windows a file with os.ModeSymlink represents a file with reparse points - if runtime.GOOS == "windows" && (mode&os.ModeSymlink) != 0 { - fs.Debugf(o, "Clearing symlink bit to allow a file with reparse points to be copied") - mode &^= os.ModeSymlink - } if mode&os.ModeSymlink != 0 { if !*skipSymlinks { fs.Logf(o, "Can't follow symlink without -L/--copy-links")