tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: zero-length symlinks



On Fri, 01 Nov 2013, David Holland wrote:
rmind@ points out that it's possible to create zero-length symlinks. As zero-length symlinks aren't sensible, this should probably be prohibited. Does anyone see any reason they shouldn't be?

Symlink names should satisfy all the rules for file system object names, so "" should not be allowed.

Symlink targets are just strings. They are usually used to store path names, but they can also be used to store arbitrary strings that can be read via readlink(2). NetBSD's malloc implementation uses /etc/malloc.conf in this way, and I don't see a reason to prohibit it from using "".

POSIX says "The string pointed to by path1 shall be treated only as a character string and shall not be validated as a pathname." <http://pubs.opengroup.org/onlinepubs/9699919799/functions/symlink.html>

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index