From 5c6a91a39d83f2fe68de28d9635076dd4066d7e2 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 14 Jul 2003 16:21:44 +1000 Subject: - (dtucker) [acconfig.h configure.ac port-aix.c] Older AIXes don't declare loginfailed at all, so assume 3-arg loginfailed if not declared. --- ChangeLog | 8 ++++++-- acconfig.h | 6 +++--- configure.ac | 29 +++++++++++++++-------------- openbsd-compat/port-aix.c | 6 +++--- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89adc1266..cddfe3c32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,11 @@ +20030714 + - (dtucker) [acconfig.h configure.ac port-aix.c] Older AIXes don't declare + loginfailed at all, so assume 3-arg loginfailed if not declared. + 20030708 - (dtucker) [acconfig.h auth-passwd.c configure.ac session.c port-aix.[ch]] Include AIX headers for authentication functions and make calls match - prototypes. Test for and handle 3-args and 4-arg variants of loginfailed. + prototypes. Test for and handle 3-arg and 4-arg variants of loginfailed. - (dtucker) [session.c] Check return value of setpcred(). - (dtucker) [auth-passwd.c auth.c session.c sshd.c port-aix.c port-aix.h] Convert aixloginmsg into platform-independant Buffer loginmsg. @@ -670,4 +674,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.2849 2003/07/08 12:59:59 dtucker Exp $ +$Id: ChangeLog,v 1.2850 2003/07/14 06:21:44 dtucker Exp $ diff --git a/acconfig.h b/acconfig.h index 23cc9c817..0af93663c 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.158 2003/07/08 10:52:13 dtucker Exp $ */ +/* $Id: acconfig.h,v 1.159 2003/07/14 06:21:44 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -110,8 +110,8 @@ /* Define if you want to enable AIX4's authenticate function */ #undef WITH_AIXAUTHENTICATE -/* Define if your AIX loginfailed() function takes 3 arguments (AIX <= 5.1) */ -#undef AIX_LOGINFAILED_3ARG +/* Define if your AIX loginfailed() function takes 4 arguments (AIX >= 5.2) */ +#undef AIX_LOGINFAILED_4ARG /* Define if you have/want arrays (cluster-wide session managment, not C arrays) */ #undef WITH_IRIX_ARRAY diff --git a/configure.ac b/configure.ac index 431c6446b..8a23469ad 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.132 2003/07/08 10:52:13 dtucker Exp $ +# $Id: configure.ac,v 1.133 2003/07/14 06:21:44 dtucker Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -75,25 +75,26 @@ case "$host" in AC_MSG_RESULT($blibflags) fi LDFLAGS="$saved_LDFLAGS" - # Check for authenticate. Might be in libs.a on older AIXes - AC_CHECK_FUNC(authenticate, [with_aixauthenticate=1], + dnl Check for authenticate. Might be in libs.a on older AIXes + AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)], [AC_CHECK_LIB(s,authenticate, - [ with_aixaixauthenticate=1 + [ AC_DEFINE(WITH_AIXAUTHENTICATE) LIBS="$LIBS -ls" ]) ]) - # Check if loginfailed takes 3 arguments (AIX <= 5.1) - if (test "x$with_aixauthenticate" = "x1" ); then - AC_DEFINE(WITH_AIXAUTHENTICATE) - AC_MSG_CHECKING(if loginfailed takes 3 arguments) - AC_TRY_COMPILE( + dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2) + AC_CHECK_DECL(loginfailed, + [AC_MSG_CHECKING(if loginfailed takes 4 arguments) + AC_TRY_COMPILE( [#include ], - [(void)loginfailed("user","host","tty");], - [AC_MSG_RESULT(yes) - AC_DEFINE(AIX_LOGINFAILED_3ARG)], + [(void)loginfailed("user","host","tty",0);], + [AC_MSG_RESULT(yes) + AC_DEFINE(AIX_LOGINFAILED_4ARG)], [AC_MSG_RESULT(no)] - ) - fi + )], + [], + [#include ] + ) AC_DEFINE(BROKEN_GETADDRINFO) AC_DEFINE(BROKEN_REALPATH) dnl AIX handles lastlog as part of its login message diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index cc6190cb8..562923720 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -92,10 +92,10 @@ record_failed_login(const char *user, const char *ttyname) { char *hostname = get_canonical_hostname(options.use_dns); -# ifdef AIX_LOGINFAILED_3ARG - loginfailed((char *)user, hostname, (char *)ttyname); -# else +# ifdef AIX_LOGINFAILED_4ARG loginfailed((char *)user, hostname, (char *)ttyname, AUDIT_FAIL_AUTH); +# else + loginfailed((char *)user, hostname, (char *)ttyname); # endif } # endif /* CUSTOM_FAILED_LOGIN */ -- cgit v1.2.3