diff options
author | Darren Tucker <dtucker@zip.com.au> | 2003-07-08 20:52:12 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2003-07-08 20:52:12 +1000 |
commit | a0c0b6311210e0cddfb1b038bd7b37f5a298ef3e (patch) | |
tree | feecc2846260789958f31ed415aa9065455879fc | |
parent | f1159b5b29069caba12dfee88a3a9fb5dc83074d (diff) |
- (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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | acconfig.h | 5 | ||||
-rw-r--r-- | auth-passwd.c | 4 | ||||
-rw-r--r-- | configure.ac | 23 | ||||
-rw-r--r-- | openbsd-compat/port-aix.c | 6 | ||||
-rw-r--r-- | openbsd-compat/port-aix.h | 9 | ||||
-rw-r--r-- | session.c | 2 |
7 files changed, 44 insertions, 12 deletions
@@ -1,3 +1,8 @@ | |||
1 | 20030708 | ||
2 | - (dtucker) [acconfig.h auth-passwd.c configure.ac session.c port-aix.[ch]] | ||
3 | Include AIX headers for authentication functions and make calls match | ||
4 | prototypes. Test for and handle 3-args and 4-arg variants of loginfailed. | ||
5 | |||
1 | 20030707 | 6 | 20030707 |
2 | - (dtucker) [configure.ac] Bug #600: Check that getrusage is declared before | 7 | - (dtucker) [configure.ac] Bug #600: Check that getrusage is declared before |
3 | searching libraries for it. Fixes build errors on NCR MP-RAS. | 8 | searching libraries for it. Fixes build errors on NCR MP-RAS. |
@@ -662,4 +667,4 @@ | |||
662 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. | 667 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. |
663 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au | 668 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au |
664 | 669 | ||
665 | $Id: ChangeLog,v 1.2846 2003/07/07 09:44:01 dtucker Exp $ | 670 | $Id: ChangeLog,v 1.2847 2003/07/08 10:52:12 dtucker Exp $ |
diff --git a/acconfig.h b/acconfig.h index e6f5ebbbd..23cc9c817 100644 --- a/acconfig.h +++ b/acconfig.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: acconfig.h,v 1.157 2003/06/11 12:51:32 djm Exp $ */ | 1 | /* $Id: acconfig.h,v 1.158 2003/07/08 10:52:13 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1999-2003 Damien Miller. All rights reserved. | 4 | * Copyright (c) 1999-2003 Damien Miller. All rights reserved. |
@@ -110,6 +110,9 @@ | |||
110 | /* Define if you want to enable AIX4's authenticate function */ | 110 | /* Define if you want to enable AIX4's authenticate function */ |
111 | #undef WITH_AIXAUTHENTICATE | 111 | #undef WITH_AIXAUTHENTICATE |
112 | 112 | ||
113 | /* Define if your AIX loginfailed() function takes 3 arguments (AIX <= 5.1) */ | ||
114 | #undef AIX_LOGINFAILED_3ARG | ||
115 | |||
113 | /* Define if you have/want arrays (cluster-wide session managment, not C arrays) */ | 116 | /* Define if you have/want arrays (cluster-wide session managment, not C arrays) */ |
114 | #undef WITH_IRIX_ARRAY | 117 | #undef WITH_IRIX_ARRAY |
115 | 118 | ||
diff --git a/auth-passwd.c b/auth-passwd.c index 9a94c373f..ea65a0125 100644 --- a/auth-passwd.c +++ b/auth-passwd.c | |||
@@ -42,15 +42,13 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $"); | |||
42 | #include "log.h" | 42 | #include "log.h" |
43 | #include "servconf.h" | 43 | #include "servconf.h" |
44 | #include "auth.h" | 44 | #include "auth.h" |
45 | #include "canohost.h" | ||
45 | 46 | ||
46 | #if !defined(HAVE_OSF_SIA) | 47 | #if !defined(HAVE_OSF_SIA) |
47 | /* Don't need any of these headers for the SIA cases */ | 48 | /* Don't need any of these headers for the SIA cases */ |
48 | # ifdef HAVE_CRYPT_H | 49 | # ifdef HAVE_CRYPT_H |
49 | # include <crypt.h> | 50 | # include <crypt.h> |
50 | # endif | 51 | # endif |
51 | # ifdef WITH_AIXAUTHENTICATE | ||
52 | # include <login.h> | ||
53 | # endif | ||
54 | # ifdef __hpux | 52 | # ifdef __hpux |
55 | # include <hpsecurity.h> | 53 | # include <hpsecurity.h> |
56 | # include <prot.h> | 54 | # include <prot.h> |
diff --git a/configure.ac b/configure.ac index 8d9143e6c..431c6446b 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.131 2003/07/07 09:44:01 dtucker Exp $ | 1 | # $Id: configure.ac,v 1.132 2003/07/08 10:52:13 dtucker Exp $ |
2 | 2 | ||
3 | AC_INIT | 3 | AC_INIT |
4 | AC_CONFIG_SRCDIR([ssh.c]) | 4 | AC_CONFIG_SRCDIR([ssh.c]) |
@@ -75,12 +75,25 @@ case "$host" in | |||
75 | AC_MSG_RESULT($blibflags) | 75 | AC_MSG_RESULT($blibflags) |
76 | fi | 76 | fi |
77 | LDFLAGS="$saved_LDFLAGS" | 77 | LDFLAGS="$saved_LDFLAGS" |
78 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)], | 78 | # Check for authenticate. Might be in libs.a on older AIXes |
79 | AC_CHECK_FUNC(authenticate, [with_aixauthenticate=1], | ||
79 | [AC_CHECK_LIB(s,authenticate, | 80 | [AC_CHECK_LIB(s,authenticate, |
80 | [ AC_DEFINE(WITH_AIXAUTHENTICATE) | 81 | [ with_aixaixauthenticate=1 |
81 | LIBS="$LIBS -ls" | 82 | LIBS="$LIBS -ls" |
82 | ]) | 83 | ]) |
83 | ]) | 84 | ]) |
85 | # Check if loginfailed takes 3 arguments (AIX <= 5.1) | ||
86 | if (test "x$with_aixauthenticate" = "x1" ); then | ||
87 | AC_DEFINE(WITH_AIXAUTHENTICATE) | ||
88 | AC_MSG_CHECKING(if loginfailed takes 3 arguments) | ||
89 | AC_TRY_COMPILE( | ||
90 | [#include <usersec.h>], | ||
91 | [(void)loginfailed("user","host","tty");], | ||
92 | [AC_MSG_RESULT(yes) | ||
93 | AC_DEFINE(AIX_LOGINFAILED_3ARG)], | ||
94 | [AC_MSG_RESULT(no)] | ||
95 | ) | ||
96 | fi | ||
84 | AC_DEFINE(BROKEN_GETADDRINFO) | 97 | AC_DEFINE(BROKEN_GETADDRINFO) |
85 | AC_DEFINE(BROKEN_REALPATH) | 98 | AC_DEFINE(BROKEN_REALPATH) |
86 | dnl AIX handles lastlog as part of its login message | 99 | 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 \ | |||
456 | login_cap.h maillock.h netdb.h netgroup.h \ | 469 | login_cap.h maillock.h netdb.h netgroup.h \ |
457 | netinet/in_systm.h paths.h pty.h readpassphrase.h \ | 470 | netinet/in_systm.h paths.h pty.h readpassphrase.h \ |
458 | rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ | 471 | rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ |
459 | strings.h sys/strtio.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ | 472 | strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \ |
460 | sys/mman.h sys/pstat.h sys/select.h sys/stat.h \ | 473 | sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \ |
461 | sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \ | 474 | sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \ |
462 | sys/un.h time.h tmpdir.h ttyent.h usersec.h \ | 475 | sys/un.h time.h tmpdir.h ttyent.h usersec.h \ |
463 | util.h utime.h utmp.h utmpx.h) | 476 | util.h utime.h utmp.h utmpx.h) |
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index b4c9454a1..c8d9517b6 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c | |||
@@ -70,7 +70,11 @@ record_failed_login(const char *user, const char *ttyname) | |||
70 | { | 70 | { |
71 | char *hostname = get_canonical_hostname(options.use_dns); | 71 | char *hostname = get_canonical_hostname(options.use_dns); |
72 | 72 | ||
73 | loginfailed(user, hostname, ttyname); | 73 | # ifdef AIX_LOGINFAILED_3ARG |
74 | loginfailed((char *)user, hostname, (char *)ttyname); | ||
75 | # else | ||
76 | loginfailed((char *)user, hostname, (char *)ttyname, AUDIT_FAIL_AUTH); | ||
77 | # endif | ||
74 | } | 78 | } |
75 | # endif /* CUSTOM_FAILED_LOGIN */ | 79 | # endif /* CUSTOM_FAILED_LOGIN */ |
76 | #endif /* _AIX */ | 80 | #endif /* _AIX */ |
diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h index 2254e7462..2787d919d 100644 --- a/openbsd-compat/port-aix.h +++ b/openbsd-compat/port-aix.h | |||
@@ -26,6 +26,15 @@ | |||
26 | 26 | ||
27 | #ifdef _AIX | 27 | #ifdef _AIX |
28 | 28 | ||
29 | #ifdef WITH_AIXAUTHENTICATE | ||
30 | # include <login.h> | ||
31 | # include <userpw.h> | ||
32 | # include <usersec.h> | ||
33 | # ifdef HAVE_SYS_AUDIT_H | ||
34 | # include <sys/audit.h> | ||
35 | # endif | ||
36 | #endif | ||
37 | |||
29 | /* AIX 4.2.x doesn't have nanosleep but does have nsleep which is equivalent */ | 38 | /* AIX 4.2.x doesn't have nanosleep but does have nsleep which is equivalent */ |
30 | #if !defined(HAVE_NANOSLEEP) && defined(HAVE_NSLEEP) | 39 | #if !defined(HAVE_NANOSLEEP) && defined(HAVE_NSLEEP) |
31 | # define nanosleep(a,b) nsleep(a,b) | 40 | # define nanosleep(a,b) nsleep(a,b) |
@@ -1215,7 +1215,7 @@ do_setusercontext(struct passwd *pw) | |||
1215 | { | 1215 | { |
1216 | 1216 | ||
1217 | #ifdef HAVE_SETPCRED | 1217 | #ifdef HAVE_SETPCRED |
1218 | setpcred(pw->pw_name); | 1218 | setpcred(pw->pw_name, (char **)NULL); |
1219 | #endif /* HAVE_SETPCRED */ | 1219 | #endif /* HAVE_SETPCRED */ |
1220 | #ifdef HAVE_LOGIN_CAP | 1220 | #ifdef HAVE_LOGIN_CAP |
1221 | # ifdef __bsdi__ | 1221 | # ifdef __bsdi__ |