Page MenuHomeFreeBSD

Allow the "@" and "!" characters in passwd file GECOS fields.
ClosedPublic

Authored by dab on Feb 26 2018, 3:28 PM.
Tags
None
Referenced Files
F103160899: D14519.id.diff
Thu, Nov 21, 6:11 PM
Unknown Object (File)
Sep 27 2024, 4:20 PM
Unknown Object (File)
Sep 17 2024, 10:55 AM
Unknown Object (File)
Sep 6 2024, 1:33 AM
Unknown Object (File)
Aug 17 2024, 6:38 PM
Unknown Object (File)
Aug 15 2024, 5:29 PM
Unknown Object (File)
Aug 15 2024, 2:00 AM
Unknown Object (File)
Aug 7 2024, 11:33 AM

Details

Summary

Two PRs (152084 & 210187) request allowing the "@" and/or "!"
characters in the passwd file GECOS field. The man page for pw does
not mention that those characters are disallowed and the "@" character
in particular would be useful for storing email addresses in that
field.

Test Plan

Modified the pw_useradd_test script to include the "@" and
"!" fields in the data for the test. Ran test. Test passed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I don't think this has any particular security implications, but adding the secteam as reviewer just in case.

I don't see any problem in principle, the restriction was introduced in r21052 but it didn't explained why it was introduced, and looks like other operating systems, nor LDAP's posixAccount schema seem to enforce similar restrictions.

Minor nit: please consider splitting the format changes in a separate commit.

This revision is now accepted and ready to land.Mar 1 2018, 12:16 AM

As we discussed offline: This will probably uncover bugs in apps that parse this field. That is not really your problem, though, and it probably will not actually happen for a long time.

If you are feeling particularly subversive, you could add these characters in some of the default users in master.passwd. That would find parser bugs pretty quickly, at least in the base system. :) It is probably not a big deal, though.

This revision was automatically updated to reflect the committed changes.