$600 bounty for symlink handling

I’ve made a build here: http://build.syncthing.net/job/syncthing-branch/189/

1 Like

The documentation (linked above, Jun 22) probably still applies. Be sure to read it, such as it is, before using this on anything important.

Here’s another, merged on v0.11.26 instead of v0.11.11 as it was originally:

http://build.syncthing.net/job/syncthing-pr/1115/

So I am keen for this to go in, regardless that its dangerous. Just add a warning.

Possibly. I dislike footguns like this, but maybe if it’s hidden behind the advanced dialog and any available docs point out the obvious pitfalls, yes.

1 Like

We can even call the config option veryDangerousFollowSymlinks

Someone should probably run it just the once on Windows with its weird junction reparse point buffer whatevers and make sure we don’t accidentally the whole system…

1 Like

unison solves this issue by specifying the symlinks explicitly in the config. in syncthing’s case it could be done that in the folder settings a new element followSymlink (singular) is introduced, which can appear several times, e.g.

<folder id="default" path="/Users/jb/Sync/" ro="false" rescanIntervalS="60" ignorePerms="false" autoNormalize="true">
    <!-- ... -->
    <followSymlink>foo/bar</followSymlink>
    <followSymlink>foo/bit/*</followSymlink>
    <!-- ... -->
</folder>

the path names given are relative to the path attribute of the folder element.

so every time a symlink is encountered during the scan, it is matched against the list of followSymlink entries (which could also include ignore pattern style globbing), and if found, the symlink is treated like it’s target (be that a symlink, file, folder or whatever).

removing a setting after a sync of the target has been performed, would replace the file/folder on a remote device with a symlink in case symlinks are supported. so files could get lost on remote devices (if they support symlinks), but never on the local device.

3 Likes

That’s actually a sensible solution.

Hi, my name is Luis and I started working with synchting. The symlink handling is very important to me, because in my case I need to follow it. When the option followSymlink would be added, it will help me allot. For now I have a script that adds the symlink as part of the path. But it isn’t ideal, because if somthing changes in the structure of the directory. I might need to spend time finding a new solution.

Keep up with the good work and thank you very much for this nice tool. Luis