Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2007 11:44:02 GMT
From:      Roy Marples<uberlord@gentoo.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/112938: utmp.h is too limiting for modern systems
Message-ID:  <200705241144.l4OBi2au011998@www.freebsd.org>
Resent-Message-ID: <200705241150.l4OBo3C5057628@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         112938
>Category:       bin
>Synopsis:       utmp.h is too limiting for modern systems
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 24 11:50:02 GMT 2007
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



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