3 ms·
The effect of restricting writes to only a directory and its descendants seems like the perfect use-case for chroot(), except that comes with some other limitat
by userbinator 4y ago
The effect of restricting writes to only a directory and its descendants seems like the perfect use-case for chroot(), except that comes with some other limitations too.
I started out computing in the PC world with the DOS family (then moving on to Windows) before working with any of the Unixes, so my perspective may be different from those who started with Unix/Linux, but in my experience it seems links (both soft and especially hard ones when applied to directories) cause a rather large number of problems in comparison to their usefulness; they make the filesystem a graph instead of a tree, adding complexity to all applications that need to traverse it.
- mort96 4y agoYou're not wrong about symlinks being problematic; there's an LWN post about it from yesterday: https://lwn.net/Articles/902247/ https://lwn.net/Articles/902247/ Luckily, most systems don't support directory hard links. (IIRC, maxOS does though, through some extremely hacky mechanism.)
- userbinator 4y agoI think you meant to link https://lwn.net/Articles/899543/ https://lwn.net/Articles/899543/ (and HN discussion at https://news.ycombinator.com/item?id=32190032 https://news.ycombinator.com/item?id=32190032 ) instead of that single comment. It takes the security angle (which is frankly oversold these days, but that's another rant...), but also makes some very good points about the complexity they introduce --- which does, among other things, create security issues. FWIW, I don't hardlinks are a good idea either. (In FAT filesystems, it is possible to have "hardlinks" where the same data is referred to by multiple names, but those are actually errors and referred to as "crosslinked files".) Without links, there's a 1-to-1 mapping between (absolute) paths and file contents. When operating on a path, there's no need to consider whether the API will act on the link or what it points to.
- saagarjha 4y agoAPFS does not support directory hardlinks, although HFS+ did.