#include "ssh.h"
#include "xmalloc.h"
#include "log.h"
+#include "auth.h"
#include "auth-pam.h"
#include "servconf.h"
#include "canohost.h"
}
/* 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);
}
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,
{
int pam_retval;
+ if (__pamh == NULL)
+ return;
+
do_pam_set_conv(&conv);
debug("PAM establishing creds");
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);
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);
}