Bug 1579 - long usernames get truncated and fail to log in
Summary: long usernames get truncated and fail to log in
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 5.2p1
Hardware: All All
: P2 major
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_6
  Show dependency treegraph
 
Reported: 2009-03-28 01:55 AEDT by Pierre Ossman
Modified: 2011-01-24 12:33 AEDT (History)
2 users (show)

See Also:


Attachments
/home/djm/sshd-loginrec-namelen-crank.diff (506 bytes, patch)
2010-06-18 14:31 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Ossman 2009-03-28 01:55:29 AEDT
A username cannot currently be longer than 128 characters as that is the size of the "username" field in struct logininfo. Under some circumstances this is not enough though.

In our specific case, we log in using the common name from a certificate, which often surpasses 128 characters. Logging in using common names from an LDAP tree is another case where username can easily get very long.

In a perfect world, the server could cope with any length, but at the very least the length should be extended. 256 bytes covers the cases we've seen, but 512 bytes might be prudent. Memory usage should not be an issue in these ranges.
Comment 1 Damien Miller 2010-06-18 14:31:58 AEST
Created attachment 1873 [details]
/home/djm/sshd-loginrec-namelen-crank.diff

crank name length to 512
Comment 2 Damien Miller 2010-06-22 15:02:53 AEST
patch applied - this will be in OpenSSH-5.6
Comment 3 Damien Miller 2011-01-24 12:33:36 AEDT
Move resolved bugs to CLOSED after 5.7 release