]> andersk Git - gssapi-openssh.git/blobdiff - openssh/auth-pam.c
updating OPENSSH_GSSAPI_Protocol1-branch with latest on the trunk (OpenSSH 3.2.3p1)
[gssapi-openssh.git] / openssh / auth-pam.c
index 8e170d40955bbda5225e2659c100ab8c2bcaf66e..eb4c61683059629de9ccbdc8267135266faebd1a 100644 (file)
@@ -28,6 +28,7 @@
 #include "ssh.h"
 #include "xmalloc.h"
 #include "log.h"
+#include "auth.h"
 #include "auth-pam.h"
 #include "servconf.h"
 #include "canohost.h"
@@ -199,10 +200,11 @@ void do_pam_cleanup_proc(void *context)
 }
 
 /* Attempt password authentation using PAM */
-int auth_pam_password(struct passwd *pw, const char *password)
+int auth_pam_password(Authctxt *authctxt, const char *password)
 {
        extern ServerOptions options;
        int pam_retval;
+       struct passwd *pw = authctxt->pw;
 
        do_pam_set_conv(&conv);
 
@@ -247,15 +249,18 @@ int do_pam_account(char *username, char *remote_user)
        }
 
        pam_retval = pam_acct_mgmt(__pamh, 0);
+       debug2("pam_acct_mgmt() = %d", pam_retval);
        switch (pam_retval) {
                case PAM_SUCCESS:
                        /* This is what we want */
                        break;
+#if 0
                case PAM_NEW_AUTHTOK_REQD:
                        message_cat(&__pam_msg, NEW_AUTHTOK_MSG);
                        /* flag that password change is necessary */
                        password_change_required = 1;
                        break;
+#endif
                default:
                        log("PAM rejected by account configuration[%d]: "
                            "%.200s", pam_retval, PAM_STRERROR(__pamh, 
@@ -294,6 +299,9 @@ void do_pam_setcred(int init)
 {
        int pam_retval;
 
+       if (__pamh == NULL)
+               return;
+
        do_pam_set_conv(&conv);
 
        debug("PAM establishing creds");
@@ -360,7 +368,7 @@ void start_pam(const char *user)
                fatal("PAM initialisation failed[%d]: %.200s",
                    pam_retval, PAM_STRERROR(__pamh, pam_retval));
 
-       rhost = get_remote_name_or_ip(utmp_len, options.reverse_mapping_check);
+       rhost = get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping);
        debug("PAM setting rhost to \"%.200s\"", rhost);
 
        pam_retval = pam_set_item(__pamh, PAM_RHOST, rhost);
@@ -402,13 +410,15 @@ char **fetch_pam_environment(void)
 int do_pam_putenv(char *name, char *value) {
        char *compound;
        int ret=1;
-       
+
+#ifdef HAVE_PAM_PUTENV 
        compound=xmalloc(strlen(name)+strlen(value)+2);
        if (compound) {
                sprintf(compound,"%s=%s",name,value);
                ret=pam_putenv(__pamh,compound);
                xfree(compound);
        }
+#endif
        return(ret);
 }
 
This page took 0.057689 seconds and 4 git commands to generate.