misc/133926: MAXLOGNAME, the username length limit, is too small

Chris Dillon cdillon at wolves.k12.mo.us
Wed Apr 22 19:10:01 UTC 2009

>Number:         133926
>Category:       misc
>Synopsis:       MAXLOGNAME, the username length limit, is too small
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 22 19:10:00 UTC 2009
>Originator:     Chris Dillon
>Release:        6.4-STABLE, 7.1-STABLE
The current 16-character username limit is too short in some situations.  "firstname.lastname" style usernames can easily exceed 16 characters.  In virtual-domain systems you may want local users with names such as "user_domain.com" which can also easily exceed 16 characters.  When using Samba with Winbind and nsswitch to integrate Active Directory users into FreeBSD, the AD domain prepended to the AD username in the format of "DOMAIN.username" will often exceed 16 characters.

Try to create or use a 16-character username.

I have been locally patching my own systems to increase MAXLOGNAME in param.h to 33 and UT_NAMESIZE in utmp.h to 32 for over 5 years and have not run into any issues regarding very long usernames.

I propose that the limit be increased to 32 or 64 characters for FreeBSD 8.0 to allow FreeBSD to be used out-of-the-box in the situations I listed in the Description.  If changing the default is not possible, we could consider a make.conf variable or something similar to make it easy for a user to re-compile the system with a larger username length limit.

As for compatibility with username length limits on other unix systems, my Google searches have hinted that there are systems which still have 8-character limits, some with 16 character limits, and others with 32 character limits, which is the highest I could find without digging too deeply.  Since we have been at 16 characters since FreeBSD 3, we broke the archaic 8 character compatibility limit a long time ago, so I doubt that defaulting our limit to 32 or 64 is going to break anything any more than it already is.


More information about the freebsd-bugs mailing list