From nobody@FreeBSD.org  Thu May 24 11:44:02 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id B792216A46E
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 May 2007 11:44:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B6B013C4B0
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 May 2007 11:44:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l4OBi2pY011999
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 May 2007 11:44:02 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l4OBi2au011998;
	Thu, 24 May 2007 11:44:02 GMT
	(envelope-from nobody)
Message-Id: <200705241144.l4OBi2au011998@www.freebsd.org>
Date: Thu, 24 May 2007 11:44:02 GMT
From: Roy Marples<uberlord@gentoo.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: utmp.h is too limiting for modern systems
X-Send-Pr-Version: www-3.0

>Number:         112938
>Category:       kern
>Synopsis:       [headers] [patch] utmp.h is too limiting for modern systems
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 24 11:50:02 GMT 2007
>Closed-Date:    Sun Apr 25 17:46:00 UTC 2010
>Last-Modified:  Sun Apr 25 17:46:00 UTC 2010
>Originator:     Roy Marples
>Release:        6.2
>Organization:
Gentoo
>Environment:
FreeBSD uberlaptop 6.2-RELEASE FreeBSD Gentoo 6.2-r1 #2: Tue May 22 13:47:09 BST 2007     root@uberlaptop:/usr/src/sys-6.2-r1/i386/compile/UBERKERNEL  i386
>Description:
utmp.h is very limiting, especially for UT_HOSTSIZE as it will not hold an ipv6 address or a long hostname. 

Fixing this should also fix bugs bin/68134, bin/53560 and bin/108743
>How-To-Repeat:
This is very obvious when you ssh into a FreeBSD box from another machine and you then re-login into it and it shows a truncated hostname or IPv6 address.
>Fix:
I propose that the limits are increased to 32 for UT_NAMESIZE, UT_LINESIZE and to 256 for UT_HOSTSIZE. This should allow for future expansion.

diff -ur a/include/sys/param.h b/include/sys/param.h
--- a/include/sys/param.h       2007-05-24 12:26:52 +0100
+++ b/include/sys/param.h       2007-05-24 12:27:50 +0100
@@ -74,7 +74,7 @@
 
 #define        MAXCOMLEN       19              /* max command name remembered */
 #define        MAXINTERP       32              /* max interpreter file name length */
-#define        MAXLOGNAME      17              /* max login name length (incl. NUL) */
+#define        MAXLOGNAME      33              /* max login name length (incl. NUL) */
 #define        MAXUPRC         CHILD_MAX       /* max simultaneous processes */
 #define        NCARGS          ARG_MAX         /* max bytes for an exec function */
 #define        NGROUPS         NGROUPS_MAX     /* max number groups */
diff -ur a/include/utmp.h b/include/utmp.h
--- a/include/utmp.h    2001-10-27 21:40:54 +0100
+++ b/include/utmp.h    2007-05-24 12:34:22 +0100
@@ -46,9 +46,9 @@
 #define        _PATH_WTMP      "/var/log/wtmp"
 #define        _PATH_LASTLOG   "/var/log/lastlog"
 
-#define        UT_NAMESIZE     16      /* see MAXLOGNAME in <sys/param.h> */
-#define        UT_LINESIZE     8
-#define        UT_HOSTSIZE     16
+#define        UT_NAMESIZE     32      /* see MAXLOGNAME in <sys/param.h> */
+#define        UT_LINESIZE     32
+#define        UT_HOSTSIZE     256
 
 struct lastlog {
        int32_t ll_time;


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jilles 
State-Changed-When: Sun Apr 25 17:45:59 UTC 2010 
State-Changed-Why:  
This has been fixed in 9-CURRENT by changing to utmpx. For compatibility 
reasons, this cannot be MFCed and utmp.h cannot be changed either (but 
you can do this locally). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112938 
>Unformatted:
