login fails on lid's > 8 chars in passwd
P. Tucker Withington
ptw at encore.UUCP
Thu Jan 10 04:03:34 AEST 1985
Index: login.c 4.33 83/09/02
I had occasion to use a long login name the other day and it wouldn't grok.
Can't say if this is a "feature", but I suppose I violated the Unix philosophy
by using more than eight chars in an identifier (:-)!
Login only reads NMAX == sizeof(utmp.u_pass) chars from tty when fetching
login id (lid), but getpwnam uses strcmp to find entries. Therefore, any passwd
entry with lid > 8 will never be found!
Repeat-by: Make a passwd lid > 8 chars and try to log in to it.
Quick fix: truncate all passwd lid's to 8.
Real fix: Either login reads more chars or getpwnam uses strncmp.
Implementation left as an exercise or for debate.
o.o --tucker
~
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list