Subject: standards/36543: internal username field lengths should be consistent
To: None <standards-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Greg A. Woods <woods@planix.com>
List: netbsd-bugs
Date: 06/24/2007 02:40:01
>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
>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 *);

>Unformatted: