From owner-freebsd-stable Mon Sep 22 09:40:59 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA26106 for stable-outgoing; Mon, 22 Sep 1997 09:40:59 -0700 (PDT) Received: from bitbox.follo.net (bitbox.follo.net [194.198.43.36]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id JAA26092 for ; Mon, 22 Sep 1997 09:40:40 -0700 (PDT) Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id SAA03613; Mon, 22 Sep 1997 18:39:49 +0200 (MET DST) Date: Mon, 22 Sep 1997 18:39:49 +0200 (MET DST) Message-Id: <199709221639.SAA03613@bitbox.follo.net> From: Eivind Eklund To: "Studded" CC: freebsd-stable@FreeBSD.ORG In-reply-to: "Studded"'s message of Sat, 20 Sep 97 17:43:53 -0700 Subject: Re: >8 char usernames going into 2.2.5? References: <199709210044.RAA18858@mail.san.rr.com> Sender: owner-freebsd-stable@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > >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 */ > >+#define UT_NAMESIZE 16 /* see MAXLOGNAME in */ > > 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.