Pathnames in /proc

H. Peter Anvin (hpa@transmeta.com)
23 Jun 1998 03:31:28 GMT


There are a number of /proc files which contain filenames, including
/proc/mounts. With the new dentry stuff these can be made
kernel-enforced reliable, which is a Good Thing[TM]. However, these
are typically delimitered by whitespace or newlines, which isn't good,
as these are legal filename characters. I would like to suggest the
convention that everywhere these is a filename in /proc (unless it is
the *entire* /proc file) there is a \0 character appended, since \0 is
the only character that is not legal in filenames (see POSIX.1).
Furthermore, \0 is not displayed on terminals, so it shouldn't affect
just catting it to the terminal. It may break simpleminded /proc
utilities, but those utilities are already broken, and may constitute
security holes.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu