+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.
+
20030707
- (dtucker) [configure.ac] Bug #600: Check that getrusage is declared before
searching libraries for it. Fixes build errors on NCR MP-RAS.
/* 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 you have/want arrays (cluster-wide session managment, not C arrays) */
#undef WITH_IRIX_ARRAY
AC_MSG_RESULT($blibflags)
fi
LDFLAGS="$saved_LDFLAGS"
- AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
+ # Check for authenticate. Might be in libs.a on older AIXes
+ AC_CHECK_FUNC(authenticate, [with_aixauthenticate=1],
[AC_CHECK_LIB(s,authenticate,
- [ AC_DEFINE(WITH_AIXAUTHENTICATE)
+ [ with_aixaixauthenticate=1
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(
+ [#include <usersec.h>],
+ [(void)loginfailed("user","host","tty");],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(AIX_LOGINFAILED_3ARG)],
+ [AC_MSG_RESULT(no)]
+ )
+ fi
AC_DEFINE(BROKEN_GETADDRINFO)
AC_DEFINE(BROKEN_REALPATH)
dnl AIX handles lastlog as part of its login message
login_cap.h maillock.h netdb.h netgroup.h \
netinet/in_systm.h paths.h pty.h readpassphrase.h \
rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
- strings.h sys/strtio.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
- sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
+ strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
+ sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
sys/un.h time.h tmpdir.h ttyent.h usersec.h \
util.h utime.h utmp.h utmpx.h)
{
char *hostname = get_canonical_hostname(options.use_dns);
- loginfailed(user, hostname, ttyname);
+# ifdef AIX_LOGINFAILED_3ARG
+ loginfailed((char *)user, hostname, (char *)ttyname);
+# else
+ loginfailed((char *)user, hostname, (char *)ttyname, AUDIT_FAIL_AUTH);
+# endif
}
# endif /* CUSTOM_FAILED_LOGIN */
#endif /* _AIX */
#ifdef _AIX
+#ifdef WITH_AIXAUTHENTICATE
+# include <login.h>
+# include <userpw.h>
+# include <usersec.h>
+# ifdef HAVE_SYS_AUDIT_H
+# include <sys/audit.h>
+# endif
+#endif
+
/* AIX 4.2.x doesn't have nanosleep but does have nsleep which is equivalent */
#if !defined(HAVE_NANOSLEEP) && defined(HAVE_NSLEEP)
# define nanosleep(a,b) nsleep(a,b)