NetBSD Problem Report #36543

From woods@building.weird.com  Sun Jun 24 02:39:59 2007
Return-Path: <woods@building.weird.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id F01FF63B882
	for <gnats-bugs@gnats.netbsd.org>; Sun, 24 Jun 2007 02:39:58 +0000 (UTC)
Message-Id: <m1I2I17-002IwcC@building.weird.com>
Date: Sat, 23 Jun 2007 22:39:57 -0400 (EDT)
From: "Greg A. Woods" <woods@planix.com>
Sender: "Greg A. Woods" <woods@building.weird.com>
Reply-To: "Greg A. Woods" <woods@planix.com>
To: gnats-bugs@NetBSD.org
Subject: internal username field lengths should be consistent
X-Send-Pr-Version: 3.95

>Number:         36543
>Category:       standards
>Synopsis:       internal username field lengths should be consistent
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 24 02:40:01 +0000 2007
>Closed-Date:    
>Last-Modified:  Thu Apr 10 02:23:31 +0000 2008
>Originator:     Greg A. Woods
>Release:        netbsd-current 2007/06/22
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:


System: NetBSD
>Description:

	the internal #defines for username field lengths should be kept
	consistent with the true maximum username length.

>How-To-Repeat:

>Fix:

	in an ideal world these would each reference UTX_USERSIZE directly

Index: sys/sys/syslimits.h
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/sys/sys/syslimits.h,v
retrieving revision 1.23
diff -u -r1.23 syslimits.h
--- sys/sys/syslimits.h	11 Dec 2005 12:25:21 -0000	1.23
+++ sys/sys/syslimits.h	3 May 2006 21:15:48 -0000
@@ -69,7 +69,7 @@
  */
 #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
     defined(_NETBSD_SOURCE)
-#define	LOGIN_NAME_MAX		   17	/* max login name length incl. NUL */
+# define LOGIN_NAME_MAX		(32+1)	/* max login name length incl. NUL, matching UTX_USERSIZE */
 #endif

 /*
Index: include/stdio.h
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/include/stdio.h,v
retrieving revision 1.69
diff -u -r1.69 stdio.h
--- include/stdio.h	30 May 2007 21:14:37 -0000	1.69
+++ include/stdio.h	11 Jun 2007 05:36:39 -0000
@@ -271,7 +271,7 @@
 #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
     defined(_NETBSD_SOURCE)
 #define	L_ctermid	1024	/* size for ctermid(); PATH_MAX */
-#define L_cuserid	9	/* size for cuserid(); UT_NAMESIZE + 1 */
+#define L_cuserid	(32+1)	/* size for cuserid(); UTX_USERSIZE + 1 */

 __BEGIN_DECLS
 char	*ctermid(char *);

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: christos@netbsd.org
State-Changed-When: Sun, 24 Jun 2007 14:34:12 -0400
State-Changed-Why:
L_cuserid is just obsolete as the man page mentions and it is there 
just for compatibility. I am not sure it is worth changing...
Changing LOGIN_NAME_MAX to 33, changes the username length in the whole
system (kernel included). Is that your intention?


From: "Greg A. Woods" <woods@planix.com>
To: NetBSD GNATS <gnats-bugs@NetBSD.org>
Cc: <standards-manager@netbsd.org>, <gnats-admin@netbsd.org>,
	<christos@netbsd.org>
Subject: Re: standards/36543 (internal username field lengths should be consistent)
Date: Sun, 24 Jun 2007 15:11:18 -0400

 --pgp-sign-Multipart_Sun_Jun_24_15:11:18_2007-1
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: quoted-printable

 At Sun, 24 Jun 2007 18:34:13 +0000 (UTC), christos@netbsd.org wrote:
 Subject: Re: standards/36543 (internal username field lengths should be con=
 sistent)
 >=20
 > Synopsis: internal username field lengths should be consistent
 >=20
 > State-Changed-From-To: open->feedback
 > State-Changed-By: christos@netbsd.org
 > State-Changed-When: Sun, 24 Jun 2007 14:34:12 -0400
 > State-Changed-Why:
 > L_cuserid is just obsolete as the man page mentions and it is there=20
 > just for compatibility. I am not sure it is worth changing...

 Hmmm... well for compatibility I think it should be consistent with the
 true length used by the system.  Otherwise it should be removed.

 > Changing LOGIN_NAME_MAX to 33, changes the username length in the whole
 > system (kernel included). Is that your intention?

 Yes, most certainly!  :-)

 If wtmpx/utmpx can store that much, then it should all be usable!

 --=20
 						Greg A. Woods

 H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
 Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>

 --pgp-sign-Multipart_Sun_Jun_24_15:11:18_2007-1
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit

 -----BEGIN PGP SIGNATURE-----
 Version: PGPfreeware 5.0i for non-commercial use
 MessageID: 33Ie+0TrHwqOlrlAfTGD76mURWv+uIr3

 iQA/AwUBRn7B1mZ9cbd4v/R/EQLLowCfSE1bZiJwfasMj1gPIIIRQ2Oq17gAnRQZ
 qF3SyDaJAUlfEGlCmNAir3Gd
 =z//N
 -----END PGP SIGNATURE-----

 --pgp-sign-Multipart_Sun_Jun_24_15:11:18_2007-1--

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 10 Apr 2008 02:23:31 +0000
State-Changed-Why:
feedback received.
Note that L_cuserid is mandated by standards, and I don't think it can be
properly defined to be anything other than what it is. It is pretty useless,
just one of those annoying things...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.