summaryrefslogtreecommitdiff
path: root/security/ssh/files/patch-aw
blob: 2f0b5a83fbb42edd2278f3e1aae22d45aebbb46c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- login.c.orig	Wed May 12 12:19:26 1999
+++ login.c	Fri Jun 18 12:11:20 1999
@@ -117,6 +117,9 @@
 #include <hpsecurity.h>
 #include <prot.h>
 #endif /* HAVE_HPUX_TCB_AUTH */
+#ifdef __FreeBSD__
+#include <osreldate.h>
+#endif
 #include "ssh.h"
 
 /* Returns the time when the user last logged in.  Returns 0 if the 
@@ -301,12 +304,15 @@
   strncpy(u.ut_user, user, sizeof(u.ut_user));
 #endif /* HAVE_NAME_IN_UTMP */
 #ifdef HAVE_HOST_IN_UTMP
-  strncpy(u.ut_host, host, sizeof(u.ut_host));
 #ifdef __FreeBSD__
+#if __FreeBSD_version >= 320000
+  trimdomain(host, sizeof u.ut_host);
+#endif
   if (strlen(host) > sizeof(u.ut_host)) {
     strncpy(u.ut_host, get_remote_ipaddr(), sizeof(u.ut_host));
-  }
+  } else
 #endif /* __FreeBSD__ */
+  strncpy(u.ut_host, host, sizeof(u.ut_host));
 #endif /* HAVE_HOST_IN_UTMP */
 #ifdef HAVE_ADDR_IN_UTMP
   if (addr)