Subject: Re: using long usernames
To: None <Netbsd-help@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 02/24/2003 22:13:35
login(1) has a pointer for the username. It truncates it to MAXLOGNAME
which is defined in /usr/include/sys/param.h which defines it as
LOGIN_NAME_MAX - 1.

LOGIN_NAME_MAX is defined in /usr/include/sys/syslimits.h as 17.

passwd->pw_name as defined in /usr/include/pwd.h is a char pointer.
(Also getpwnam(8) uses a char pointer.)

UT_NAMESIZE as used by last(1) and other logging of user logins is 8
characters. This could be increased too and the reporting tools fixed for
outputing truncated and complete usernames. (They truncate hostnames too.)

The sysctl kern.login_name_max returns LOGIN_NAME_MAX (17) as defined in
/usr/src/sys/kern/kern_sysctl.c.

Also, the group length should be checked too (since some admins may choose
to have groups match the long usernames).

   Jeremy C. Reed
   http://www.reedmedia.net/