nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.92k stars 773 forks source link

macOS: storing apps can destroy them because they may contain symbolic links #820

Open SchroedersKater opened 5 years ago

SchroedersKater commented 5 years ago

When syncing a macOS app (which in fact is a kind of folder) that has been developed with Xojo this app may get destroyed because it can contain (and almost always does) symbolic links which will be refused by the Nextcloud because of this link.

I suggest that symlinks inside an app on macOS are uploaded as the files they are. Otherwise these apps become destroyed and don’t work any more.

BTW, Messages look like this: 04.11.18 12:34:37,Fotografieren/Colors for/Luminar/Xojo/Builds - Colors for Luminar.xojo_binary_project/OS X 64 bit/Colors for Luminar.app/Contents/Frameworks/XojoFramework.framework/Resources, /Volumes/Daten,Symbolische Verknüpfungen werden bei der Synchronisation nicht unterstützt.

Steps to reproduce

  1. Put a Xojo developed app inside a folder that is synced with the macOS Nextcloud app

Expected behaviour

Treat symbolic links inside macOS apps as files.

Actual behaviour

Symbolic links inside macOS apps are ignored. And therefore the app becomes destroyed.

nextcloud-bot commented 5 years ago

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/1927 (Follow symbolic links), https://github.com/nextcloud/server/issues/3592 (App Store: Category for All Apps), https://github.com/nextcloud/server/issues/3591 (App Store: Sorting of Apps), https://github.com/nextcloud/server/issues/5377 (AppStore link for non-published apps), and https://github.com/nextcloud/server/issues/9440 ([Feature Request] Virtual Directories / Symbolic Links).

SchroedersKater commented 5 years ago

Well, they are related, but do not treat the same issue.

MorrisJobke commented 5 years ago

This is more an issue of the desktop client. Let me move it there: https://github.com/nextcloud/desktop

SchroedersKater commented 5 years ago

@Morris:

Thank you very much. You are very welcome to do this. I haven't seen that section before!

rullzer commented 5 years ago

@MorrisJobke this is not really a client issue. We do not support symlinks in Nextcloud. Thus we can't just sync this.

Also just syncing the file behind a symlink is tricky because this would need

  1. cycle detection
  2. We'd need to make sure the target is not outside of the nextcloud folder
MorrisJobke commented 5 years ago

@MorrisJobke this is not really a client issue. We do not support symlinks in Nextcloud. Thus we can't just sync this.

But then it should just not allow it in the client or am I wrong here?

SchroedersKater commented 5 years ago

Sorry, but I disagree. Not supporting symbolic links should exactly do what I requested. Copy them as file.

The client could very well detect if this link is inside an app. Otherwise it is very dangerous to save macOS apps in Nextcloud because you never can be sure to get back what you synced. I was very surprised when syncing some apps between an iMac and a MacBook Pro because they were unusable.

If this behaviour is kept, I'd better go back to another sync service which syncs symbolic links as files (even outside of apps).

rullzer commented 5 years ago

what might be possible is to allow 1 level of indirection. that way we get across the cyclic link issue.

MorrisJobke commented 5 years ago

what might be possible is to allow 1 level of indirection. that way we get across the cyclic link issue.

Even this could be problematic, because it could be a symlink to a parent directory :/

SchroedersKater commented 5 years ago

If I understand you right, you mean to follow the link for 1 level.

But this would also lead to a destroyed app. I repeat: Don't follow the link, just store the file. Following the link inside an app would mean not to leave the app in its original condition.

SchroedersKater commented 5 years ago

Is this the end of the discussion, meaning nothing will happen?

rullzer commented 5 years ago

@SchroedersKater symlinks are not just files. At least nog on all systems. So we'd need to examine that properly.

Of course Pull Requests with a solution are welcome.

SchroedersKater commented 5 years ago

@rullzer They are at least on macOS and it should be the client's responsibility to handle them correctly. And the simple solution would be to handle them as files. BTW this is what is done by some other cloud service as well, if I remember this right (i would have to research if you want to learn more). Anyway, this would not be so much a difference from the current state.