passdb.c revision f3d506e525a720f214020ca0f989a1966b30edae
/* Copyright (c) 2002-2010 Dovecot authors, see the included COPYING file */
#include "auth-common.h"
#include "array.h"
#include "password-scheme.h"
#include "auth-worker-server.h"
#include "passdb.h"
#include <stdlib.h>
{
struct passdb_module_interface *const *ifaces;
return iface;
}
return NULL;
}
{
struct passdb_module_interface *old_iface;
/* replacing a "support not compiled in" passdb */
i_panic("passdb_register_module(%s): Already registered",
}
}
{
struct passdb_module_interface *const *ifaces;
unsigned int idx;
return;
}
}
}
const char *input, const char *input_scheme,
{
int ret;
if (auth_request->prefer_plain_credentials &&
/* we've a plaintext scheme and we prefer to get it instead
of converting it to the fallback scheme */
wanted_scheme = "";
}
if (ret <= 0) {
if (ret < 0) {
"Password in passdb is not in expected scheme %s",
} else {
"Unknown scheme %s", input_scheme);
}
return FALSE;
}
if (*wanted_scheme == '\0') {
/* anything goes. change the credentials_scheme to what we
actually got, so blocking passdbs work. */
return TRUE;
}
const char *error = t_strdup_printf(
"Requested %s scheme, but we have only %s",
}
"%s", error);
return FALSE;
}
/* we can generate anything out of plaintext passwords */
if (!auth_request->domain_is_realm &&
/* domain must not be used as realm. add the @realm. */
}
"Generating %s from user '%s', password '%s'",
}
"Requested unknown scheme %s", wanted_scheme);
return FALSE;
}
}
return TRUE;
}
struct auth_request *auth_request)
{
const unsigned char *credentials;
if (result != PASSDB_RESULT_OK) {
return;
}
"Requested %s scheme, but we have a NULL password",
&credentials, &size)) {
}
}
struct passdb_module *
{
static unsigned int auth_passdb_id = 0;
struct passdb_module_interface *iface;
struct passdb_module *passdb;
i_fatal("Support not compiled in for passdb driver '%s'",
driver);
}
else
return passdb;
}
{
}
}
{
}
extern struct passdb_module_interface passdb_passwd;
extern struct passdb_module_interface passdb_bsdauth;
extern struct passdb_module_interface passdb_shadow;
extern struct passdb_module_interface passdb_passwd_file;
extern struct passdb_module_interface passdb_pam;
extern struct passdb_module_interface passdb_checkpassword;
extern struct passdb_module_interface passdb_vpopmail;
extern struct passdb_module_interface passdb_ldap;
extern struct passdb_module_interface passdb_sql;
extern struct passdb_module_interface passdb_sia;
void passdbs_init(void)
{
}
void passdbs_deinit(void)
{
}