Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Sep 1997 18:39:49 +0200 (MET DST)
From:      Eivind Eklund <perhaps@yes.no>
To:        "Studded" <Studded@dal.net>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: >8 char usernames going into 2.2.5?
Message-ID:  <199709221639.SAA03613@bitbox.follo.net>
In-Reply-To: "Studded"'s message of Sat, 20 Sep 97 17:43:53 -0700
References:  <199709210044.RAA18858@mail.san.rr.com>

index | next in thread | previous in thread | raw e-mail

> >Index: sys/sys/param.h
> >=========================================================
> >RCS file: /home/ncvs/src/sys/sys/param.h,v
> 
> >-#define	MAXLOGNAME	12  /* max login name length */
> >+#define	MAXLOGNAME	17  /* max login name length */
> 
> >Index: include/utmp.h
> >=========================================================
> >RCS file: /home/ncvs/src/include/utmp.h,v
> 
> >-#define UT_NAMESIZE 8 /* see MAXLOGNAME in <sys/param.h> */
> >+#define UT_NAMESIZE 16 /* see MAXLOGNAME in <sys/param.h> */
> 
> 	Ok, why is there a discrepancy here?  If you told me that the change 
> was easy to make, and all I had to do was change the numbers in those two 
> files, the first thing I'd do is ask myself why they were already different, then 
> I'd make them both 16.  Obviously I'd be wrong, but can someone explain to 
> a non-programmer why I want the value in param.h to be higher than the 
> one in utmp.h?  

Quick guess: MAXLOGNAME is supposed to include a zero terminator in
the count (a single null character to indicate the end of the name),
UT_NAMESIZE is just copied into a buffer with strncpy() and written to
utmp, and strncpy() cut the terminator character if the string is too
long for it.

Eivind.


home | help

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