summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--acconfig.h10
-rw-r--r--configure.in21
-rw-r--r--sshd.c18
4 files changed, 40 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c016a32b..eb79657af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,8 +6,10 @@
6 key there. show fingerprint instead of public-key after 6 key there. show fingerprint instead of public-key after
7 keygeneration. ok niels@ 7 keygeneration. ok niels@
8 - Added OpenBSD bsd-strlcat.c, created bsd-strlcat.h 8 - Added OpenBSD bsd-strlcat.c, created bsd-strlcat.h
9 - Added timersum() macro 9 - Added timersub() macro
10 - Tidy RCSIDs of bsd-*.c 10 - Tidy RCSIDs of bsd-*.c
11 - Added autoconf test and macro to deal with old PAM libraries
12 pam_strerror definition (one arg vs two).
11 13
1219991121 1419991121
13 - OpenBSD CVS Changes: 15 - OpenBSD CVS Changes:
diff --git a/acconfig.h b/acconfig.h
index db7fd18b1..6459c6371 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -54,6 +54,10 @@
54/* Define if you want to allow MD5 passwords */ 54/* Define if you want to allow MD5 passwords */
55#undef HAVE_MD5_PASSWORDS 55#undef HAVE_MD5_PASSWORDS
56 56
57/* Define if you have an old version of PAM which takes only one argument */
58/* to pam_strerror */
59#undef HAVE_OLD_PAM
60
57/* Data types */ 61/* Data types */
58#undef HAVE_QUAD_T 62#undef HAVE_QUAD_T
59#undef HAVE_INTXX_T 63#undef HAVE_INTXX_T
@@ -195,3 +199,9 @@ enum
195 } while (0) 199 } while (0)
196 200
197#endif 201#endif
202
203#ifdef HAVE_OLD_PAM
204# define PAM_STRERROR(a,b) pam_strerror((b))
205#else
206# define PAM_STRERROR(a,b) pam_strerror((a),(b))
207#endif
diff --git a/configure.in b/configure.in
index 1fe0c30b4..0678fa4c8 100644
--- a/configure.in
+++ b/configure.in
@@ -77,7 +77,7 @@ AC_CHECK_SIZEOF(long int, 4)
77AC_CHECK_SIZEOF(long long int, 8) 77AC_CHECK_SIZEOF(long long int, 8)
78 78
79dnl More checks for data types 79dnl More checks for data types
80AC_MSG_CHECKING([For quad_t]) 80AC_MSG_CHECKING([for quad_t])
81AC_TRY_COMPILE( 81AC_TRY_COMPILE(
82 [#include <sys/types.h>], 82 [#include <sys/types.h>],
83 [quad_t a; a = 1235;], 83 [quad_t a; a = 1235;],
@@ -88,7 +88,7 @@ AC_TRY_COMPILE(
88 [AC_MSG_RESULT(no)] 88 [AC_MSG_RESULT(no)]
89) 89)
90 90
91AC_MSG_CHECKING([For intXX_t types]) 91AC_MSG_CHECKING([for intXX_t types])
92AC_TRY_COMPILE( 92AC_TRY_COMPILE(
93 [#include <sys/types.h>], 93 [#include <sys/types.h>],
94 [int16_t a; int32_t b; a = 1235; b = 1235;], 94 [int16_t a; int32_t b; a = 1235; b = 1235;],
@@ -99,7 +99,7 @@ AC_TRY_COMPILE(
99 [AC_MSG_RESULT(no)] 99 [AC_MSG_RESULT(no)]
100) 100)
101 101
102AC_MSG_CHECKING([For u_intXX_t types]) 102AC_MSG_CHECKING([for u_intXX_t types])
103AC_TRY_COMPILE( 103AC_TRY_COMPILE(
104 [#include <sys/types.h>], 104 [#include <sys/types.h>],
105 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;], 105 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;],
@@ -121,6 +121,21 @@ AC_TRY_COMPILE(
121 [AC_MSG_RESULT(no)] 121 [AC_MSG_RESULT(no)]
122) 122)
123 123
124dnl Check PAM strerror arguments
125AC_MSG_CHECKING([whether pam_strerror takes only one argument])
126AC_TRY_COMPILE(
127 [
128 #include <stdlib.h>
129 #include <security/pam_appl.h>
130 ],
131 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
132 [AC_MSG_RESULT(no)],
133 [
134 AC_DEFINE(HAVE_OLD_PAM)
135 AC_MSG_RESULT(yes)
136 ]
137)
138
124dnl Check whether use wants to disable the external ssh-askpass 139dnl Check whether use wants to disable the external ssh-askpass
125INSTALL_ASKPASS="yes" 140INSTALL_ASKPASS="yes"
126AC_MSG_CHECKING([whether to enable external ssh-askpass support]) 141AC_MSG_CHECKING([whether to enable external ssh-askpass support])
diff --git a/sshd.c b/sshd.c
index 5d8fa6dbe..e87810767 100644
--- a/sshd.c
+++ b/sshd.c
@@ -18,7 +18,7 @@ agent connections.
18*/ 18*/
19 19
20#include "includes.h" 20#include "includes.h"
21RCSID("$Id: sshd.c,v 1.27 1999/11/21 07:31:57 damien Exp $"); 21RCSID("$Id: sshd.c,v 1.28 1999/11/22 03:27:24 damien Exp $");
22 22
23#include "xmalloc.h" 23#include "xmalloc.h"
24#include "rsa.h" 24#include "rsa.h"
@@ -221,14 +221,14 @@ void pam_cleanup_proc(void *context)
221 if (pam_retval != PAM_SUCCESS) 221 if (pam_retval != PAM_SUCCESS)
222 { 222 {
223 log("Cannot close PAM session: %.200s", 223 log("Cannot close PAM session: %.200s",
224 pam_strerror((pam_handle_t *)pamh, pam_retval)); 224 PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
225 } 225 }
226 226
227 pam_retval = pam_end((pam_handle_t *)pamh, pam_retval); 227 pam_retval = pam_end((pam_handle_t *)pamh, pam_retval);
228 if (pam_retval != PAM_SUCCESS) 228 if (pam_retval != PAM_SUCCESS)
229 { 229 {
230 log("Cannot release PAM authentication: %.200s", 230 log("Cannot release PAM authentication: %.200s",
231 pam_strerror((pam_handle_t *)pamh, pam_retval)); 231 PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
232 } 232 }
233 } 233 }
234} 234}
@@ -244,7 +244,7 @@ void do_pam_account_and_session(char *username, char *remote_user,
244 pam_retval = pam_set_item((pam_handle_t *)pamh, PAM_RHOST, remote_host); 244 pam_retval = pam_set_item((pam_handle_t *)pamh, PAM_RHOST, remote_host);
245 if (pam_retval != PAM_SUCCESS) 245 if (pam_retval != PAM_SUCCESS)
246 { 246 {
247 log("PAM set rhost failed: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval)); 247 log("PAM set rhost failed: %.200s", PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
248 do_fake_authloop(username); 248 do_fake_authloop(username);
249 } 249 }
250 } 250 }
@@ -255,7 +255,7 @@ void do_pam_account_and_session(char *username, char *remote_user,
255 pam_retval = pam_set_item((pam_handle_t *)pamh, PAM_RUSER, remote_user); 255 pam_retval = pam_set_item((pam_handle_t *)pamh, PAM_RUSER, remote_user);
256 if (pam_retval != PAM_SUCCESS) 256 if (pam_retval != PAM_SUCCESS)
257 { 257 {
258 log("PAM set ruser failed: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval)); 258 log("PAM set ruser failed: %.200s", PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
259 do_fake_authloop(username); 259 do_fake_authloop(username);
260 } 260 }
261 } 261 }
@@ -263,14 +263,14 @@ void do_pam_account_and_session(char *username, char *remote_user,
263 pam_retval = pam_acct_mgmt((pam_handle_t *)pamh, 0); 263 pam_retval = pam_acct_mgmt((pam_handle_t *)pamh, 0);
264 if (pam_retval != PAM_SUCCESS) 264 if (pam_retval != PAM_SUCCESS)
265 { 265 {
266 log("PAM rejected by account configuration: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval)); 266 log("PAM rejected by account configuration: %.200s", PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
267 do_fake_authloop(username); 267 do_fake_authloop(username);
268 } 268 }
269 269
270 pam_retval = pam_open_session((pam_handle_t *)pamh, 0); 270 pam_retval = pam_open_session((pam_handle_t *)pamh, 0);
271 if (pam_retval != PAM_SUCCESS) 271 if (pam_retval != PAM_SUCCESS)
272 { 272 {
273 log("PAM session setup failed: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval)); 273 log("PAM session setup failed: %.200s", PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
274 do_fake_authloop(username); 274 do_fake_authloop(username);
275 } 275 }
276} 276}
@@ -1206,7 +1206,7 @@ do_authentication(char *user)
1206 1206
1207 pam_retval = pam_start("sshd", pw->pw_name, &conv, (pam_handle_t**)&pamh); 1207 pam_retval = pam_start("sshd", pw->pw_name, &conv, (pam_handle_t**)&pamh);
1208 if (pam_retval != PAM_SUCCESS) 1208 if (pam_retval != PAM_SUCCESS)
1209 fatal("PAM initialisation failed: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval)); 1209 fatal("PAM initialisation failed: %.200s", PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
1210 1210
1211 fatal_add_cleanup(&pam_cleanup_proc, NULL); 1211 fatal_add_cleanup(&pam_cleanup_proc, NULL);
1212 } 1212 }
@@ -1456,7 +1456,7 @@ do_authloop(struct passwd *pw)
1456 } 1456 }
1457 1457
1458 log("PAM Password authentication for \"%.100s\" failed: %s", 1458 log("PAM Password authentication for \"%.100s\" failed: %s",
1459 pw->pw_name, pam_strerror((pam_handle_t *)pamh, pam_retval)); 1459 pw->pw_name, PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
1460 break; 1460 break;
1461#else /* HAVE_LIBPAM */ 1461#else /* HAVE_LIBPAM */
1462 /* Try authentication with the password. */ 1462 /* Try authentication with the password. */