# $600 bounty for symlink handling

**URL:** https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493
**Category:** Development
**Created:** [April 21, 2015, 1:13pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493 "2015-04-21T13:13:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![acunningham](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@acunningham](https://forum.syncthing.net/u/acunningham)
#### Post date: [April 21, 2015, 1:13pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/1 "2015-04-21T13:13:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [April 21, 2015, 1:42pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/2 "2015-04-21T13:42:03Z")

</div>

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. ;))

---

<div class="post-metadata">

### Author: ![acunningham](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@acunningham](https://forum.syncthing.net/u/acunningham)
#### Post date: [April 21, 2015, 1:53pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/3 "2015-04-21T13:53:57Z")

</div>

Thank you for clarifying.

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

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [April 25, 2015, 11:17pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/4 "2015-04-25T23:17:19Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![acunningham](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@acunningham](https://forum.syncthing.net/u/acunningham)
#### Post date: [May 5, 2015, 9:06am UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/6 "2015-05-05T09:06:01Z")

</div>

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

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [May 5, 2015, 9:11am UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/7 "2015-05-05T09:11:01Z")

</div>

Not me yet, so far. 😕

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [May 5, 2015, 9:30am UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/8 "2015-05-05T09:30:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [June 21, 2015, 9:23pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/9 "2015-06-21T21:23:09Z")

</div>

For a preview of this, take a look at [http://build.syncthing.net/job/syncthing-pr/671/](http://build.syncthing.net/job/syncthing-pr/671/) and see what works. Note [http://docs.syncthing.net/draft/followsymlinks.html](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.

---

<div class="post-metadata">

### Author: ![acunningham](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@acunningham](https://forum.syncthing.net/u/acunningham)
#### Post date: [June 22, 2015, 8:11am UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/10 "2015-06-22T08:11:05Z")

</div>

Thank you for working on this!

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [July 5, 2015, 8:53am UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/11 "2015-07-05T08:53:47Z")

</div>

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. 😉

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

> <https://github.com/syncthing/syncthing/pull/1983>

---

<div class="post-metadata">

### Author: ![kahun](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/k/9de053/32.png) [@kahun](https://forum.syncthing.net/u/kahun)
#### Post date: [July 7, 2015, 4:17am UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/12 "2015-07-07T04:17:18Z")

</div>

Great progress

---

<div class="post-metadata">

### Author: ![kahun](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/k/9de053/32.png) [@kahun](https://forum.syncthing.net/u/kahun)
#### Post date: [July 8, 2015, 10:05pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/13 "2015-07-08T22:05:59Z")

</div>

Hi

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

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [July 8, 2015, 10:08pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/14 "2015-07-08T22:08:07Z")

</div>

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

---

<div class="post-metadata">

### Author: ![acunningham](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@acunningham](https://forum.syncthing.net/u/acunningham)
#### Post date: [October 8, 2015, 8:56pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/15 "2015-10-08T20:56:03Z")

</div>

Has anything more happened with this?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [October 9, 2015, 1:53pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/16 "2015-10-09T13:53:27Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![acunningham](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@acunningham](https://forum.syncthing.net/u/acunningham)
#### Post date: [October 9, 2015, 2:27pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/17 "2015-10-09T14:27:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [October 9, 2015, 5:27pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/18 "2015-10-09T17:27:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![acunningham](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@acunningham](https://forum.syncthing.net/u/acunningham)
#### Post date: [October 10, 2015, 2:38pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/19 "2015-10-10T14:38:56Z")

</div>

Is there an available download for Linux?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [October 10, 2015, 4:06pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/20 "2015-10-10T16:06:19Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![acunningham](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/96bed5/32.png) [@acunningham](https://forum.syncthing.net/u/acunningham)
#### Post date: [October 10, 2015, 4:17pm UTC](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493/21 "2015-10-10T16:17:23Z")

</div>

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

[Next page](https://forum.syncthing.net/t/600-bounty-for-symlink-handling/2493.md?page=2)
