patch for NetBSD utmp (ut_name instead of ut_host)
Jun-ichiro itojun Hagino
itojun at iijlab.net
Mon Jul 3 08:08:44 EST 2000
here are patches to compile portable openssh 2.1.1p2 on netbsd,
and some other platforms I suppose.
itojun
-------------- next part --------------
$NetBSD: patch-aa,v 1.8 2000/07/02 22:07:56 itojun Exp $
--- configure.in.orig Sat Jul 1 15:52:55 2000
+++ configure.in Mon Jul 3 06:49:00 2000
@@ -647,2 +647,6 @@
+OSSH_CHECK_HEADER_FOR_FIELD(ut_name, utmp.h, HAVE_NAME_IN_UTMP)
+OSSH_CHECK_HEADER_FOR_FIELD(ut_name, utmpx.h, HAVE_NAME_IN_UTMPX)
+OSSH_CHECK_HEADER_FOR_FIELD(ut_user, utmp.h, HAVE_USER_IN_UTMP)
+OSSH_CHECK_HEADER_FOR_FIELD(ut_user, utmpx.h, HAVE_USER_IN_UTMPX)
OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
-------------- next part --------------
$NetBSD: patch-al,v 1.1 2000/07/02 22:07:56 itojun Exp $
--- loginrec.c- Mon Jul 3 06:49:20 2000
+++ loginrec.c Mon Jul 3 06:51:59 2000
@@ -618,3 +618,9 @@
/* Use strncpy because we don't necessarily want null termination */
+# ifdef HAVE_USER_IN_UTMP
strncpy(ut->ut_user, li->username, MIN_SIZEOF(ut->ut_user, li->username));
+# elif defined(HAVE_NAME_IN_UTMP)
+ strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username));
+# else
+# error no ut_user nor ut_name
+# endif
# ifdef HAVE_HOST_IN_UTMP
@@ -1008,4 +1014,12 @@
{
+# ifdef HAVE_USER_IN_UTMP
if (strncmp(li->username, ut->ut_user,
- MIN_SIZEOF(li->username, ut->ut_user)) == 0) {
+ MIN_SIZEOF(li->username, ut->ut_user)) == 0)
+# elif defined(HAVE_NAME_IN_UTMP)
+ if (strncmp(li->username, ut->ut_name,
+ MIN_SIZEOF(li->username, ut->ut_name)) == 0)
+# else
+# error no ut_user nor ut_name
+# endif
+ {
# ifdef HAVE_TYPE_IN_UTMP
@@ -1163,4 +1177,12 @@
{
+# ifdef HAVE_USER_IN_UTMP
if ( strncmp(li->username, utx->ut_user,
- MIN_SIZEOF(li->username, utx->ut_user)) == 0 ) {
+ MIN_SIZEOF(li->username, utx->ut_user)) == 0 )
+# elif defined(HAVE_NAME_IN_UTMP)
+ if ( strncmp(li->username, utx->ut_name,
+ MIN_SIZEOF(li->username, utx->ut_name)) == 0 )
+# else
+# error no ut_user nor ut_name
+# endif
+ {
# ifdef HAVE_TYPE_IN_UTMPX
-------------- next part --------------
$NetBSD: patch-am,v 1.1 2000/07/02 22:07:56 itojun Exp $
--- acconfig.h- Mon Jul 3 06:58:28 2000
+++ acconfig.h Mon Jul 3 06:58:09 2000
@@ -49,2 +49,6 @@
/* struct utmp and struct utmpx fields */
+#undef HAVE_NAME_IN_UTMP
+#undef HAVE_NAME_IN_UTMPX
+#undef HAVE_USER_IN_UTMP
+#undef HAVE_USER_IN_UTMPX
#undef HAVE_HOST_IN_UTMP
More information about the openssh-unix-dev
mailing list