diff options
author | Jeremy Allison <jra@samba.org> | 2001-05-01 18:25:20 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-05-01 18:25:20 +0000 |
commit | 52a9226a5aaa769e960619c2bd0a561dd9b0493d (patch) | |
tree | 341307a8502a996f79fafddb05ef023cc2705452 | |
parent | d9b960b4a5997e4cd09e3da9ea4754cbae1e29b3 (diff) | |
download | samba-52a9226a5aaa769e960619c2bd0a561dd9b0493d.tar.gz samba-52a9226a5aaa769e960619c2bd0a561dd9b0493d.tar.xz samba-52a9226a5aaa769e960619c2bd0a561dd9b0493d.zip |
Runtime check for broken PAM systems with no appdata_ptr support. This
should eventually be an autoconf test with a #ifdef workaround. I *HATE* pam :-).
Jeremy.
-rw-r--r-- | source/auth/pampass.c | 24 | ||||
-rw-r--r-- | source/passdb/pampass.c | 24 |
2 files changed, 44 insertions, 4 deletions
diff --git a/source/auth/pampass.c b/source/auth/pampass.c index 68024f94810..8f62d353173 100644 --- a/source/auth/pampass.c +++ b/source/auth/pampass.c @@ -113,6 +113,16 @@ static int smb_pam_conv(int num_msg, *resp = NULL; + /* + * Apparantly HPUX has a buggy PAM that doesn't support the + * appdata_ptr. Fail if this is the case. JRA. + */ + + if (udp == NULL) { + DEBUG(0,("smb_pam_conv: PAM on this system is broken - appdata_ptr == NULL !\n")); + return PAM_CONV_ERR; + } + reply = malloc(sizeof(struct pam_response) * num_msg); if (!reply) return PAM_CONV_ERR; @@ -170,6 +180,18 @@ static int smb_pam_passchange_conv(int num_msg, char *p = lp_passwd_chat(); struct smb_pam_userdata *udp = (struct smb_pam_userdata *)appdata_ptr; + *resp = NULL; + + /* + * Apparantly HPUX has a buggy PAM that doesn't support the + * appdata_ptr. Fail if this is the case. JRA. + */ + + if (udp == NULL) { + DEBUG(0,("smb_pam_passchange_conv: PAM on this system is broken - appdata_ptr == NULL !\n")); + return PAM_CONV_ERR; + } + /* Get the prompts... */ if (!next_token(&p, currentpw_prompt, NULL, sizeof(fstring))) @@ -179,8 +201,6 @@ static int smb_pam_passchange_conv(int num_msg, if (!next_token(&p, repeatpw_prompt, NULL, sizeof(fstring))) return PAM_CONV_ERR; - *resp = NULL; - reply = malloc(sizeof(struct pam_response) * num_msg); if (!reply) return PAM_CONV_ERR; diff --git a/source/passdb/pampass.c b/source/passdb/pampass.c index 68024f94810..8f62d353173 100644 --- a/source/passdb/pampass.c +++ b/source/passdb/pampass.c @@ -113,6 +113,16 @@ static int smb_pam_conv(int num_msg, *resp = NULL; + /* + * Apparantly HPUX has a buggy PAM that doesn't support the + * appdata_ptr. Fail if this is the case. JRA. + */ + + if (udp == NULL) { + DEBUG(0,("smb_pam_conv: PAM on this system is broken - appdata_ptr == NULL !\n")); + return PAM_CONV_ERR; + } + reply = malloc(sizeof(struct pam_response) * num_msg); if (!reply) return PAM_CONV_ERR; @@ -170,6 +180,18 @@ static int smb_pam_passchange_conv(int num_msg, char *p = lp_passwd_chat(); struct smb_pam_userdata *udp = (struct smb_pam_userdata *)appdata_ptr; + *resp = NULL; + + /* + * Apparantly HPUX has a buggy PAM that doesn't support the + * appdata_ptr. Fail if this is the case. JRA. + */ + + if (udp == NULL) { + DEBUG(0,("smb_pam_passchange_conv: PAM on this system is broken - appdata_ptr == NULL !\n")); + return PAM_CONV_ERR; + } + /* Get the prompts... */ if (!next_token(&p, currentpw_prompt, NULL, sizeof(fstring))) @@ -179,8 +201,6 @@ static int smb_pam_passchange_conv(int num_msg, if (!next_token(&p, repeatpw_prompt, NULL, sizeof(fstring))) return PAM_CONV_ERR; - *resp = NULL; - reply = malloc(sizeof(struct pam_response) * num_msg); if (!reply) return PAM_CONV_ERR; |