Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jan 2011 16:04:04 +0100
From:      Mateusz Kwiatkowski <kwiat3k@panic.pl>
To:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Question about FreeBSD and long usernames
Message-ID:  <20110119160404.5d47ad6f@stokrotka.t1.gda.wp-sa.pl>

next in thread | raw e-mail | index | archive | help
Hi, 

I have noticed inconsistent behaviour of some tools while working with
long usernames.

At first, 17 chars username (UT_NAMESIZE is set to 16, MAXLOGNAME to
17):
# pw user add verylongusername 
pwd_mkdb: jira_pawprintgames: username too long

But it is possible to create such user with vipw:
# id verylongusername
uid=1005(verylongusername) gid=1003(users) groups=1003(users)

We can make use of this account:
su - verylongusername
% id
uid=1005(verylongusername) gid=1003(users) groups=1003(users)

# passwd verylongusername
Changing local password for verylongusername
New Password:
Retype New Password:
#

18 chars username:
# id verylongusername1 
uid=1006(verylongusername1) gid=1003(users) groups=1003(users)

# su - verylongusername1
su: username too long

# sudo -u verylongusername1 id
uid=1006(verylongusername1) gid=1003(users) groups=1003(users)

It's possible to change password:
# passwd verylongusername1
Changing local password for verylongusername1
New Password:
Retype New Password:
#

When trying to login with ssh (17 chars username worked ok):
Jan 19 14:46:08 xxxx sshd[39050]: setlogin(verylongusername1):
Invalid argument

Why some tools deny using long usernames, while
others permit? Should it be corrected?

Cheers, 
Mateusz




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110119160404.5d47ad6f>