passdb-pam.c revision 798cfe56c9871262770384da1239162b3800cce1
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen Based on auth_pam.c from popa3d by Solar Designer <solar@openwall.com>.
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen You're allowed to do whatever you like with this software (including
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen re-distribution in source and/or binary form, with or without
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen modification), provided that credit is given where it is due and any
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainen modified versions are marked as such. There's absolutely no warranty.
#include <stdlib.h>
#ifdef HAVE_SECURITY_PAM_APPL_H
# define SUNPAM
#ifdef SUNPAM
# define linux_const
# define linux_const const
struct pam_passdb_module {
unsigned int requests_left;
struct pam_conv_context {
const char *pass;
const char *failure_msg;
char *string;
for (i = 0; i < num_msg; i++) {
case PAM_PROMPT_ECHO_ON:
case PAM_PROMPT_ECHO_OFF:
case PAM_ERROR_MSG:
case PAM_TEXT_INFO:
return PAM_CONV_ERR;
return PAM_SUCCESS;
#ifdef SUNPAM
return NULL;
const char *path;
if (service_checked) {
return NULL;
return path;
return NULL;
const char *service)
int status;
switch (status) {
case PAM_USER_UNKNOWN:
NULL);
return status;
#ifdef HAVE_PAM_SETCRED
PAM_SUCCESS) {
return status;
return status;
return status;
return status;
return status;
return PAM_SUCCESS;
const char *host;
static enum passdb_result
const char *password)
return PASSDB_RESULT_INTERNAL_FAILURE;
return PASSDB_RESULT_INTERNAL_FAILURE;
switch (status) {
case PAM_SUCCESS:
case PAM_USER_UNKNOWN:
case PAM_NEW_AUTHTOK_REQD:
case PAM_ACCT_EXPIRED:
return result;
const char *service;
static struct passdb_module *
const char *const *t_args;
NULL,
NULL,
NULL,