utmp_len

Dag-Erling Smørgrav des at des.no
Thu Sep 25 07:26:42 EST 2008


In sshd.c:

/* record remote hostname or ip */
u_int utmp_len = MAXHOSTNAMELEN;

However, HOSTNAMELEN is almost certainly too long.  Is there a reason
not to use UT_HOSTSIZE instead, as below?

Index: sshd.c
===================================================================
--- sshd.c       (revision 182719)
+++ sshd.c       (working copy)
@@ -72,6 +72,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <utmp.h>
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -238,7 +239,7 @@
 u_int session_id2_len = 0;
 
 /* record remote hostname or ip */
-u_int utmp_len = MAXHOSTNAMELEN;
+u_int utmp_len = UT_HOSTSIZE;
 
 /* options.max_startup sized array of fd ints */
 int *startup_pipes = NULL;

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the openssh-unix-dev mailing list