retval = pam_start("http", auth_userpass, &conv, &pamh);
syslog(LOG_INFO, "before pam_set_item..........................\n");
pam_set_item(pamh, PAM_AUTHTOK, pwd);
if (retval == PAM_SUCCESS) {
retval = pam_authenticate(pamh, 0); /* is user really user? */
}
else {
syslog(LOG_INFO, "--Not authenticated - pam start failed\n");
}
/* This is where we have been authorized or not. */
if (retval == PAM_SUCCESS) {
syslog(LOG_INFO, "Authentication successful for %s from %s\n", auth_userpass, req->remote_ip_addr);
strncpy(req->user, auth_userpass, 15);
req->user[15] = '\0';
if (pam_end(pamh,retval) != PAM_SUCCESS) { /* close Linux-PAM */
pamh = NULL;
syslog(LOG_ERR, "http: failed to release pam authenticator\n");
}
return 1;
}
Thanks,
N
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html