The trouble with symbolic links
The trouble with symbolic links
Posted Jul 7, 2022 16:07 UTC (Thu) by khim (subscriber, #9252)In reply to: The trouble with symbolic links by Sesse
Parent article: The trouble with symbolic links
> I believe it's a bit of a stretch to say that “pathnames as a concept are now utterly broken in POSIX” just because userspace cannot verify that a path name is contained within some arbitrary part of the file system.
It's like saying that car without wheels and an engine is not broken. I mean: you can still pull it with enough horses attached thus move people and cargo, right? So it's still usable, kinda.
Similarly here: the only difference between pathname and filename is the fact that pathnames have hierarchy.
Sure, apps which don't need pathnames but are just happy to use them as opaque file identifiers in a flat namespace are not broken with symlinks. But everything else is broken is a sense that Joe Average Developer would write incorrect code 10 times out of 10.
How you can call this “not utterly broken” is beyond me.
> Most applications will not have to care whether there's a directory symlink in the path, even if Samba needs to do its own userspace chroot.On the contrary: practically any app which deals with file hierarchies (and just with individual files) is broken. Not all such programs lead to security vulnerability because sometimes you have situation “Joe can break Joe's program which s/he can crash directly anyway” which is considered acceptable. But they are broken, nonetheless.
