[lug] Allowed Characters in passwd for comment (full name)
David L. Anselmi
anselmi at anselmi.us
Wed Jan 20 09:46:59 MST 2016
George Sexton wrote:
> So I've found out today that a : is probably not an allowed character in the password file for the
> user comment field.
>
> Does anyone know of any others I should be looking for?
The man page doesn't say. Since : is the delimiter it would at least have to be escaped to use in a
field. But my sense is that passwd(5) predates that sort of convention.
I guess you'd have to look at the code to know for sure but here are some guesses:
Nul, because it's the delimiter for C strings.
non-ASCII characters. Without a spec it's probably safe to assume the file is ASCII. But maybe
other encodings are supported. So is it 7 bit ASCII or 8?
non-printable ASCII characters. These may be handled by now but there was probably an assumption
once that comments would be printable characters.
If you do happen to look at the source you might submit a patch to the man page to document what you
find.
Dave
More information about the LUG
mailing list