]> andersk Git - openssh.git/commitdiff
- (dtucker) [acconfig.h auth-passwd.c configure.ac session.c port-aix.[ch]]
authordtucker <dtucker>
Tue, 8 Jul 2003 10:52:12 +0000 (10:52 +0000)
committerdtucker <dtucker>
Tue, 8 Jul 2003 10:52:12 +0000 (10:52 +0000)
   Include AIX headers for authentication functions and make calls match
   prototypes.  Test for and handle 3-args and 4-arg variants of loginfailed.

ChangeLog
acconfig.h
auth-passwd.c
configure.ac
openbsd-compat/port-aix.c
openbsd-compat/port-aix.h
session.c

index 5fdf7e6707c4cac61a9e8effb0e5c6d89b592c30..c1ddf0be7aa01fd1f361d947ef31a58dcfdc3c89 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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.
index a2286248265822e682e752d33b52b8a0e18eb17f..38754daac3788c642efd256160695322b22ee04f 100644 (file)
 /* 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
 
index 9a94c373f026c48cec839c040a9d70f6feab346b..ea65a0125f836d961b2aff6d85f481b993951b4b 100644 (file)
@@ -42,15 +42,13 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $");
 #include "log.h"
 #include "servconf.h"
 #include "auth.h"
+#include "canohost.h"
 
 #if !defined(HAVE_OSF_SIA)
 /* Don't need any of these headers for the SIA cases */
 # ifdef HAVE_CRYPT_H
 #  include <crypt.h>
 # endif
-# ifdef WITH_AIXAUTHENTICATE
-#  include <login.h>
-# endif
 # ifdef __hpux
 #  include <hpsecurity.h>
 #  include <prot.h>
index d7af03411e831e34eb2390dd7aef77a225f93bd8..b2b6a71f4bf10206dc080ec585a3d6d5565637ed 100644 (file)
@@ -75,12 +75,25 @@ case "$host" in
                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
@@ -456,8 +469,8 @@ AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
        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)
index b4c9454a1f5d914a925b9b495092e16bc64b7a4a..c8d9517b604e50972a59bd3012af05925268618d 100644 (file)
@@ -70,7 +70,11 @@ record_failed_login(const char *user, const char *ttyname)
 {
        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 */
index 2254e746230f240ce8ab7ec3e71fcf1090aa6b7e..2787d919d28c3ec9d88315cf77ddfff594e8ae26 100644 (file)
 
 #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)
index dc9777de9443bfef97fb90bbd35facec7fee1d33..ac57c3d0f3c83e551831eeaa98bdf1d5f25d4598 100644 (file)
--- a/session.c
+++ b/session.c
@@ -1215,7 +1215,7 @@ do_setusercontext(struct passwd *pw)
        {
 
 #ifdef HAVE_SETPCRED
-               setpcred(pw->pw_name);
+               setpcred(pw->pw_name, (char **)NULL);
 #endif /* HAVE_SETPCRED */
 #ifdef HAVE_LOGIN_CAP
 # ifdef __bsdi__
This page took 0.050515 seconds and 5 git commands to generate.