Subject: Re: long usernames
To: David Laight <>
From: Sean Davis <>
List: tech-kern
Date: 02/13/2003 09:53:46
On Thu, Feb 13, 2003 at 12:05:54PM +0000, David Laight wrote:
> Since sysctl kern.login_name_max = 17 you would expect to be able
> to have usenames that are 16 chars long.
> However the longest one that works is actually 14!
> Attempting to use longer names fails at login time:
> login: setlogin(usersixteenchars) failure: Invalid argument
> login: setlogin(userfifteenchar) failure: Invalid argument
> The 'problem' seems to be twofold:
> 1) sys___setlogin() calls copyinstr( , , sizeof(s->s_login) - 1, )
> 2) sizeof(s->s_login) is 16, so this has to be able to handle a name
>    that is missing the final null.  Nothing allows for that.
> Should this be fixed?

I think it should. Something that also bugs me is /etc/security's mailing me
complaining about usernames that are longer than 8 characters. Is there a file
somewhere that I can configure the max login length, so a longer than 8 yet
smaller than kern.login_name_max login name won't cause excessive spam in the
security mail?

(The security mail part is why I also CC'd this to tech-userlevel)

/~\ The ASCII
\ / Ribbon Campaign                   Sean Davis
 X  Against HTML                       aka dive
/ \ Email!