[go: up one dir, main page]

|
|
Log in / Subscribe / Register

The trouble with symbolic links

The trouble with symbolic links

Posted Jul 8, 2022 13:00 UTC (Fri) by ilammy (subscriber, #145312)
In reply to: The trouble with symbolic links by adobriyan
Parent article: The trouble with symbolic links

If you open a file in multiple tabs via multiple paths, edits in one of them should reflect in the other, immediately.

If a symlink in the open path has changed while a file is being edited, users might or might not want to be notified about that instead of overwriting some other file.

If there is a symlink loop, search by all files in the project should not hang or print out infinite results.


to post comments

The trouble with symbolic links

Posted Jul 8, 2022 13:05 UTC (Fri) by Sesse (subscriber, #53779) [Link]

I find this example pretty contrived, but OK: stat() the file and check its inode number. (There's no new TOCTTOU, since editors typically don't keep the file descriptors open anyway.)

The trouble with symbolic links

Posted Jul 8, 2022 20:24 UTC (Fri) by nybble41 (subscriber, #55106) [Link]

The first two cases would also be an issue with hard links. You can't assume that a different path means a different file. And all three are possible with bind mounts, network filesystems, FUSE filesystems, or removable devices without involving symlinks in any way, so you need to handle those cases properly whether or not symlinks are available. For example the third case could be addressed by checking the device and inode numbers for each directory to prevent recursion, and also setting an absolute limit on the depth of the search.

The trouble with symbolic links

Posted Jul 8, 2022 22:26 UTC (Fri) by k8to (guest, #15413) [Link]

This is .. not standard text editor behavior.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds