Subject: Re: bin/8428: uucpd truncates login names at 8 characters
To: None <netbsd-bugs@netbsd.org,>
From: Greg A. Woods <woods@most.weird.com>
List: netbsd-bugs
Date: 09/24/1999 15:51:12
[ On Friday, September 24, 1999 at 13:51:55 (-0400), Bill Sommerfeld wrote: ]
> Subject: Re: bin/8428: uucpd truncates login names at 8 characters 
>
> No.  The correct fix here is to eliminate the 8-character limit
> wherever it's found in the system.

Indeed that would be the "correct" fix.  That's what I said!  ;-)
However we do need an extensible utmp/wtmp file format first.  I can
think of at least a half-dozen ways of doing this off the top of my head
though so until there's a bit more consensus I'm not about to pick one
of them and implement it on my own.

Also, unless you either eliminate the (bogus IMO) setlogin()/getlogin()
system calls, or allow arbitrary length crap to be stored in the kernel,
there's still going to have to be a real hard limit somewhere.  I'd
rather not have arbitrary length per-session or per-process data in my
kernel, even if it can only be put there by root.  In fact I'd rather
the kernel went back to never knowing the user-name at all, ever, Period.

In the mean time I'd REALLY like to see things at least made internally
consistent!  Hell even the documentation isn't consistent with the
current inconsistency!  Add the following to my previous patch:

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>

Index: src/lib/libc/sys/getlogin.2
===================================================================
RCS file: /cvs/NetBSD/src/lib/libc/sys/getlogin.2,v
retrieving revision 1.1.1.2
diff -c -c -r1.1.1.2 src/lib/libc/sys/getlogin.2
*** src/sys/libc/sys/getlogin.2	1998/11/16 20:38:26	1.1.1.2
--- src/sys/libc/sys/getlogin.2	1999/09/24 19:48:05
***************
*** 33,39 ****
  .\"
  .\"	@(#)getlogin.2	8.1 (Berkeley) 6/9/93
  .\"
! .Dd June 9, 1993
  .Dt GETLOGIN 2
  .Os BSD 4.2
  .Sh NAME
--- 33,39 ----
  .\"
  .\"	@(#)getlogin.2	8.1 (Berkeley) 6/9/93
  .\"
! .Dd September 24, 1999
  .Dt GETLOGIN 2
  .Os BSD 4.2
  .Sh NAME
***************
*** 98,104 ****
  .Dv MAXLOGNAME
  (from
  .Ao Pa sys/param.h Ac )
! characters, currently 12.
  .It Bq Er EPERM
  The caller tried to set the login name and was not the super-user.
  .El
--- 98,104 ----
  .Dv MAXLOGNAME
  (from
  .Ao Pa sys/param.h Ac )
! characters, currently 8.
  .It Bq Er EPERM
  The caller tried to set the login name and was not the super-user.
  .El
***************
*** 110,121 ****
  function conforms to
  .St -p1003.1-90 .
  .Sh BUGS
! Login names are limited in length by
  .Fn setlogin .
! However, lower limits are placed on login names elsewhere in the system
! .Pf ( Dv UT_NAMESIZE
  in
! .Ao Pa utmp.h Ac ) .
  .Pp
  In earlier versions of the system,
  .Fn getlogin
--- 110,132 ----
  function conforms to
  .St -p1003.1-90 .
  .Sh BUGS
! Login names are primarily limited in length by
  .Fn setlogin .
! However other independent parts of the system have related limits, such
! as
! .Dv UT_NAMESIZE
  in
! .Ao Pa utmp.h Ac ,
! and
! .Dv L_cuserid
! in
! .Ao Pa stdio.h Ac .
! Even worse some applications may still independently use magic numbers
! instead of one of the above defines.  None of these values should be
! changed without changing the others, and of course care must be taken
! when changing them to not make existing data, such as that in
! .Pa /var/log/wtmp
! archives, inaccessible.
  .Pp
  In earlier versions of the system,
  .Fn getlogin