$600 bounty for symlink handling

I’m offering a bounty of 600 US dollars for a per-folder setting for how to handle symlinks in the Linux client. A select box with the following choices, per folder, would be sufficient to fulfil my needs, though I’m open to discussion of other ideas:

A. Ignore symlinks found on the source filesystem, which is how Syncthing currently behaves.

B. Follow symlinks found on the source filesystem. Loop detection is done to prevent infinite recursion, and links that would cause loops are not followed.

C. Copy symlinks found on the source filesystem as symlinks if the destination filesystem support symlinks, else ignore them. No translation is done of the symlink destination.

Option B is the one I really care about. The developer is welcome to add other options if they wish.

This bounty is payable via PayPal to whoever adds the necessary feature to the Syncthing client for Linux, once it’s included in a mainline release (i.e. not a special one-off version), as long as this happens before the end of 2015.

Others who would like to see this feature (I know you’re out there!) are invited to contribute to the bounty.


The current behavior is actually C.

(I might take a stab at this, if noone else picks it up and I get to choose a charity to send the $600 to - grabbing them myself feels like cheating. ;))

Thank you for clarifying.

Yes, I’m happy to pay the bounty to a charity of your choice.

@calmh If you secretly coded your own version and then favoured it above competing entries, that might be a bit underhand.

If you do it openly and fairly, then I see no reason why you shouldn’t take the dosh if you want to. You deserve it and shouldn’t feel obliged to give it away. (On the other hand, you shouldn’t be pressured into taking it either).

I imagine that the op would be happy for you to code it whether you keep the money or not.


Out of curiosity, has anyone decided to work on this?

Not me yet, so far. :confused:

I might take a stab at it in a few weeks, given calmh hasn’t finished it by then.

For a preview of this, take a look at http://build.syncthing.net/job/syncthing-pr/671/ and see what works. Note http://docs.syncthing.net/draft/followsymlinks.html - especially don’t turn on and then off again the FollowSymlinks setting on live data without understanding the consequences.

Thank you for working on this!

I’ve done a little bit more work on it, and it is indeed a mess of corner cases and potential security issues. It may still work correctly, potentially, but it’s scary. :wink:

For the curious, here’s the ongoing work/discussion:

Great progress


Is this <followSymlinks>true</followSymlinks> available in 11.13 Linux?

It hasn’t yet been merged due to all the possible disaster scenarios.

Has anything more happened with this?

I implemented the thing linked above, not sure if you tested it. It works for what it is, but as noted the whole symlink thing is a corner case nightmare and I’m not sure it deserves to be merged.

Oh, I wasn’t aware that it was ready for testing. Is there a download link for a .apk I can try?

The standard releases don’t include android packages, it’s contributed by someone kind enough in the community, so the best we could offer is an .so which you could swap in the apk/install location.

Is there an available download for Linux?

There were, when I linked the pull request above (the pull request has builds at the end), but that’s expired and now wildly out of date, sorry.

There’s some discussion in the PR about the problems with it, but the main one is handling the turning-off of FollowSymlinks or when a symlink is removed. This obviously results in the linked files being deleted everywhere else, and a symlink put in place instead. Under some circumstances those deletes can come back and haunt you, resulting in a delete on the “origin” device as well. That’s bad.

Also some unintuitive things like the fact that when FollowSymlinks is enabled we must not allow any other device to cause us to create a symlink, or we will follow it and give them back all files it point to. It’s fixable but introduces a number of special cases and magic behavior that need to happen only in the FollowSymlinks case.

Hmm, I see. Maybe it would be best to abandon this idea for now?