Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot remove/unlink symlink which has nonexistent target #165

Closed
jonaslb opened this issue Mar 28, 2019 · 2 comments
Closed

Cannot remove/unlink symlink which has nonexistent target #165

jonaslb opened this issue Mar 28, 2019 · 2 comments
Labels

Comments

@jonaslb
Copy link

jonaslb commented Mar 28, 2019

Executing ln -s nonexistent_file newlink and later rm newlink or unlink newlink works as expected on when executed in any local folder. However, if it is executed in an sshfs mount, the first command exits with an error:

ln: failed to create symbolic link 'newlink': No such file or directory

But a file is created anyway. It is listed as follows (ls -la):

??????????  ? ?     ?           ?            ? newlink

But if using ls -la on the remote machine, the link is listed correctly:

lrwxrwxrwx  1 jolub s13       11 28 mar 17:21 newlink -> nonexistent

The link can be removed on the remote via unlink or rm as expected, but it does not work when unlink or rm is executed locally in the mounted folder. In that case unlink (or rm) exits with the following message:

unlink: cannot unlink 'newlink': No such file or directory
@jonaslb
Copy link
Author

jonaslb commented Mar 28, 2019

I should say that I have used the -o follow_symlinks option for mounting, but nothing else. I haven't tested it without that option.

@Nikratio
Copy link
Contributor

Thanks for the report! This is expected behavior with -o follow_symlinks - this means that whenever SSHFS encounters a symlink, it will attempt to follow it instead of acting on the symlink itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants