auth-pam.c support for pam_chauthtok()
Damien Miller
djm at mindrot.org
Wed Dec 20 10:43:38 EST 2000
On Mon, 18 Dec 2000, Andrew Morgan wrote:
> [Much time passes, and I'm working my way through 1600 ssh messages..]
>
> I believe this patch contains a bug. Its really a Sun documentation bug
> that no one noticed until 4 years after Linux had a working PAM
> implementation (read, its not going to change in the Linux
> implementation of PAM now) and two years after Sun released their first
> PAM support.
[snip]
> * Linux provides a pointer to an array of message pointers.
>
> * Solaris provides a pointer to a pointer to an array of message
> structures (yes this is somewhat bizzarre with one unnecessary level of
> indirection).
Would this be correct?
Index: auth-pam.c
===================================================================
RCS file: /var/cvs/openssh/auth-pam.c,v
retrieving revision 1.19
diff -u -r1.19 auth-pam.c
--- auth-pam.c 2000/12/03 00:51:51 1.19
+++ auth-pam.c 2000/12/19 23:43:09
@@ -97,7 +97,11 @@
return PAM_CONV_ERR;
for (count = 0; count < num_msg; count++) {
- switch ((*msg)[count].msg_style) {
+#ifdef PAM_SUN
+ switch((*msg)[count].msg_style) {
+#else /* PAM_SUN */
+ switch(msg[count]->msg_style) {
+#endif /* PAM_SUN */
case PAM_PROMPT_ECHO_ON:
if (pamstate == INITIAL_LOGIN) {
free(reply);
Index: auth2-pam.c
===================================================================
RCS file: /var/cvs/openssh/auth2-pam.c,v
retrieving revision 1.1
diff -u -r1.1 auth2-pam.c
--- auth2-pam.c 2000/12/03 00:51:51 1.1
+++ auth2-pam.c 2000/12/19 23:43:10
@@ -79,7 +79,11 @@
packet_put_int(j); /* Number of prompts. */
context_pam2.num_expected = j;
for (i = 0, j = 0; i < num_msg; i++) {
+#ifdef PAM_SUN
switch((*msg)[i].msg_style) {
+#else /* PAM_SUN */
+ switch(msg[i]->msg_style) {
+#endif /* PAM_SUN */
case PAM_PROMPT_ECHO_ON:
echo = 1;
break;
Index: configure.in
===================================================================
RCS file: /var/cvs/openssh/configure.in,v
retrieving revision 1.205
diff -u -r1.205 configure.in
--- configure.in 2000/12/18 19:58:57 1.205
+++ configure.in 2000/12/19 23:43:12
@@ -77,6 +77,7 @@
fi
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
IPADDR_IN_DISPLAY=yes
+ AC_DEFINE(PAM_SUN)
AC_DEFINE(USE_PIPES)
AC_DEFINE(DISABLE_SHADOW)
AC_DEFINE(DISABLE_UTMP)
@@ -88,6 +89,7 @@
*-*-hpux11*)
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
IPADDR_IN_DISPLAY=yes
+ AC_DEFINE(PAM_SUN)
AC_DEFINE(USE_PIPES)
AC_DEFINE(DISABLE_SHADOW)
AC_DEFINE(DISABLE_UTMP)
@@ -149,6 +151,7 @@
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
need_dash_r=1
+ AC_DEFINE(PAM_SUN)
# hardwire lastlog location (can't detect it on some versions)
conf_lastlog_location="/var/adm/lastlog"
AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
@@ -164,6 +167,7 @@
*-*-sunos4*)
CPPFLAGS="$CPPFLAGS -DSUNOS4"
AC_CHECK_FUNCS(getpwanam)
+ AC_DEFINE(PAM_SUN)
conf_utmp_location=/etc/utmp
conf_wtmp_location=/var/adm/wtmp
conf_lastlog_location=/var/adm/lastlog
--
| ``We've all heard that a million monkeys banging on | Damien Miller -
| a million typewriters will eventually reproduce the | <djm at mindrot.org>
| works of Shakespeare. Now, thanks to the Internet, /
| we know this is not true.'' - Robert Wilensky UCB / http://www.mindrot.org
More information about the openssh-unix-dev
mailing list