[solaris 7 patch] resubmit and extended ...

Damien Miller djm at mindrot.org
Sat Nov 20 12:22:46 EST 1999


On Fri, 19 Nov 1999, Marc G. Fournier wrote:

I have merged most of you changes, and included autoconf support 
for detecting and automatically defining u_intXX_t.

Can you try out the attached patch to see if it helps.

Regards,
Damien

--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)


-------------- next part --------------
Index: ChangeLog
===================================================================
RCS file: /var/cvs/openssh/ChangeLog,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -u -r1.58 -r1.59
--- ChangeLog	1999/11/19 04:53:20	1.58
+++ ChangeLog	1999/11/20 01:18:40	1.59
@@ -1,3 +1,9 @@
+19991120
+ - Merged more Solaris support from Marc G. Fournier 
+   <marc.fournier at acadiau.ca>
+ - Wrote autoconf tests for integer bit-types
+ - Fixed enabling kerberos support
+
 19991119
  - Merged PAM buffer overrun patch from Chip Salzenberg <chip at valinux.com>
  - Merged OpenBSD CVS changes
Index: TODO
===================================================================
RCS file: /var/cvs/openssh/TODO,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- TODO	1999/11/12 03:35:58	1.3
+++ TODO	1999/11/20 01:18:40	1.4
@@ -8,6 +8,8 @@
 
 - Fix paths in manpages using autoconf
 
-- Enable libwrap support using autoconf switch
-
 - Better testing on non-PAM systems
+
+- Replace the horror in acconfig.h which tries to comphensate for the 
+  lack of u_intXX_t types. There must be a better way.
+
Index: acconfig.h
===================================================================
RCS file: /var/cvs/openssh/acconfig.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -u -r1.13 -r1.14
--- acconfig.h	1999/11/19 04:53:20	1.13
+++ acconfig.h	1999/11/20 01:18:40	1.14
@@ -6,6 +6,9 @@
 /* Location of lastlog file */
 #undef LASTLOG_LOCATION
 
+/* If lastlog is a directory */
+#undef LASTLOG_IS_DIR
+
 /* Location of random number pool  */
 #undef RANDOM_POOL
 
@@ -51,13 +54,22 @@
 /* Define if you want to allow MD5 passwords */
 #undef HAVE_MD5_PASSWORDS
 
+/* Data types */
+#undef HAVE_QUAD_T
+#undef HAVE_INTXX_T
+#undef HAVE_U_INTXX_T
+#undef HAVE_UINTXX_T
+
 @BOTTOM@
 
 /* ******************* Shouldn't need to edit below this line ************** */
+
+# include <sys/types.h> /* For u_intXX_t */
+# include <sys/socket.h> /* For SHUT_XXXX */
 
-#include <sys/types.h> /* For u_intXX_t */
-#include <sys/socket.h> /* For SHUT_XXXX */
-#include <paths.h> /* For _PATH_XXX */
+#ifdef HAVE_PATHS_H
+# include <paths.h> /* For _PATH_XXX */
+#endif 
 
 #ifndef SHUT_RDWR
 enum
@@ -71,16 +83,63 @@
 };
 #endif
 
-#if !defined(u_int32_t) && defined(uint32_t)
-#define u_int32_t uint32_t
+/* If sys/types.h does not supply intXX_t, supply them ourselves */
+/* (or die trying) */
+#ifndef HAVE_INTXX_T
+# if (SIZEOF_SHORT_INT == 2)
+#  define int16_t short int
+# else
+#  error "16 bit int type not found."
+# endif
+# if (SIZEOF_INT == 4)
+#  define int32_t int
+# else
+#  error "32 bit int type not found."
+# endif
+# if (SIZEOF_LONG_INT == 8)
+#  define int64_t long int
+# else
+#  if (SIZEOF_LONG_LONG_INT == 8)
+#   define int64_t long long int
+#  else
+#   error "64 bit int type not found."
+#  endif
+# endif
 #endif
 
-#if !defined(u_int16_t) && defined(uint16_t)
-#define u_int16_t uint16_t
+/* If sys/types.h does not supply u_intXX_t, supply them ourselves */
+#ifndef HAVE_U_INTXX_T
+# ifdef HAVE_UINTXX_T
+#  define u_int16_t uint16_t
+#  define u_int32_t uint32_t
+#  define u_int64_t uint64_t
+# else
+#  if (SIZEOF_SHORT_INT == 2)
+#   define u_int16_t unsigned short int
+#  else
+#   error "16 bit int type not found."
+#  endif
+#  if (SIZEOF_INT == 4)
+#   define u_int32_t unsigned int
+#  else
+#   error "32 bit int type not found."
+#  endif
+#  if (SIZEOF_LONG_INT == 8)
+#   define u_int64_t unsigned long int
+#  else
+#   if (SIZEOF_LONG_LONG_INT == 8)
+#    define u_int64_t unsigned long long int
+#   else
+#    error "64 bit int type not found."
+#   endif
+#  endif
+# endif
 #endif
 
-#if !defined(quad_t) && defined(int64_t)
-#define quad_t int64_t
+/* If quad_t is not supplied, then supply it now. We can rely on int64_t */
+/* being defined by the above */
+#ifndef HAVE_QUAD_T
+# define quad_t int64_t
 #endif
 
 #ifndef _PATH_LASTLOG
Index: bsd-daemon.c
===================================================================
RCS file: /var/cvs/openssh/bsd-daemon.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -u -r1.1 -r1.2
--- bsd-daemon.c	1999/11/19 04:32:34	1.1
+++ bsd-daemon.c	1999/11/20 01:18:40	1.2
@@ -40,8 +40,11 @@
 #endif /* LIBC_SCCS and not lint */
 
 #include <fcntl.h>
-#include <paths.h>
 #include <unistd.h>
+
+#ifdef HAVE_PATHS_H
+# include <paths.h>
+#endif 
 
 int
 daemon(nochdir, noclose)
Index: bsd-login.c
===================================================================
RCS file: /var/cvs/openssh/bsd-login.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -u -r1.1 -r1.2
--- bsd-login.c	1999/11/19 04:32:34	1.1
+++ bsd-login.c	1999/11/20 01:18:40	1.2
@@ -37,7 +37,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 /* from: static char sccsid[] = "@(#)login.c	8.1 (Berkeley) 6/4/93"; */
-static char *rcsid = "$Id: bsd-login.c,v 1.1 1999/11/19 04:32:34 damien Exp $";
+static char *rcsid = "$Id: bsd-login.c,v 1.2 1999/11/20 01:18:40 damien Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -58,6 +58,7 @@
 
 	tty = ttyslot();
 	if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) >= 0) {
+#ifdef HAVE_HOST_IN_UTMP
 		(void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
 		/*
 		 * Prevent luser from zero'ing out ut_host.
@@ -70,6 +71,7 @@
 		    strncmp(old_ut.ut_line, utp->ut_line, UT_LINESIZE) == 0 &&
 		    strncmp(old_ut.ut_name, utp->ut_name, UT_NAMESIZE) == 0)
 			(void)memcpy(utp->ut_host, old_ut.ut_host, UT_HOSTSIZE);
+#endif /* HAVE_HOST_IN_UTMP */
 		(void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
 		(void)write(fd, utp, sizeof(struct utmp));
 		(void)close(fd);
Index: configure.in
===================================================================
RCS file: /var/cvs/openssh/configure.in,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -u -r1.21 -r1.22
--- configure.in	1999/11/19 08:14:04	1.21
+++ configure.in	1999/11/20 01:18:40	1.22
@@ -70,6 +70,57 @@
 	[AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
 )
 
+dnl Checks for data types
+AC_CHECK_SIZEOF(short int, 2)
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long int, 4)
+AC_CHECK_SIZEOF(long long int, 8)
+
+dnl More checks for data types
+AC_MSG_CHECKING([For quad_t])
+AC_TRY_COMPILE(
+	[#include <sys/types.h>], 
+	[quad_t a; a = 1235;], 
+	[
+		AC_DEFINE(HAVE_QUAD_T)
+		AC_MSG_RESULT(yes)
+	],
+	[AC_MSG_RESULT(no)]
+) 
+
+AC_MSG_CHECKING([For intXX_t types])
+AC_TRY_COMPILE(
+	[#include <sys/types.h>], 
+	[int16_t a; int32_t b; a = 1235; b = 1235;], 
+	[
+		AC_DEFINE(HAVE_INTXX_T)
+		AC_MSG_RESULT(yes)
+	],
+	[AC_MSG_RESULT(no)]
+) 
+
+AC_MSG_CHECKING([For u_intXX_t types])
+AC_TRY_COMPILE(
+	[#include <sys/types.h>], 
+	[u_int16_t c; u_int32_t d; c = 1235; d = 1235;], 
+	[
+		AC_DEFINE(HAVE_U_INTXX_T)
+		AC_MSG_RESULT(yes)
+	],
+	[AC_MSG_RESULT(no)]
+) 
+
+AC_MSG_CHECKING([For uintXX_t types])
+AC_TRY_COMPILE(
+	[#include <sys/types.h>], 
+	[uint16_t c; uint32_t d; c = 1235; d = 1235;], 
+	[
+		AC_DEFINE(HAVE_UINTXX_T)
+		AC_MSG_RESULT(yes)
+	],
+	[AC_MSG_RESULT(no)]
+) 
+
 dnl Check whether use wants to disable the external ssh-askpass
 INSTALL_ASKPASS="yes"
 AC_MSG_CHECKING([whether to enable external ssh-askpass support])
@@ -158,14 +209,23 @@
 AC_MSG_CHECKING([location of lastlog file])
 for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
 	if test -f $lastlog ; then
-		gotlastlog="yes"
-		AC_MSG_RESULT($lastlog)
-		AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
+		gotlastlog="file"
+		break
+	fi
+	if test -d $lastlog ; then
+		gotlastlog="dir"
 		break
 	fi
 done
 if test -z "$gotlastlog" ; then
 	AC_MSG_ERROR([*** Cannot find lastlog ***])
+else
+	if test "x$gotlastlog" = "xdir" ; then
+		AC_DEFINE(LASTLOG_IS_DIR)
+		AC_MSG_ERROR([*** Directory-based lastlogs are not yet supported ***])
+	fi
+	AC_MSG_RESULT($lastlog)
+	AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
 fi	
 
 AC_MSG_CHECKING([whether libc defines __progname])
@@ -191,7 +251,7 @@
 )
 
 dnl Check whether user wants AFS support
-AC_ARG_WITH(kerberos4,
+AC_ARG_WITH(afs,
 	[  --with-afs              Enable AFS support],
 	[
 		AC_DEFINE(AFS)


More information about the openssh-unix-dev mailing list