passdb-shadow.c revision 580ba11d9d96736a537ebd919136377dbb34c1b0
/* Copyright (c) 2002-2013 Dovecot authors, see the included COPYING file */
#include "auth-common.h"
#include "passdb.h"
#ifdef PASSDB_SHADOW
#include "safe-memset.h"
#include <shadow.h>
#define SHADOW_CACHE_KEY "%u"
#define SHADOW_PASS_SCHEME "CRYPT"
static enum passdb_result
{
return PASSDB_RESULT_USER_UNKNOWN;
}
"invalid password field");
return PASSDB_RESULT_USER_DISABLED;
}
/* save the password so cache can use it */
return PASSDB_RESULT_OK;
}
static void
{
enum passdb_result res;
int ret;
if (res != PASSDB_RESULT_OK) {
return;
}
/* check if the password is valid */
SHADOW_PASS_SCHEME, "shadow");
/* clear the passwords from memory */
if (ret <= 0) {
return;
}
/* make sure we're using the username exactly as it's in the database */
}
static void
{
enum passdb_result res;
if (res != PASSDB_RESULT_OK) {
return;
}
/* make sure we're using the username exactly as it's in the database */
}
static struct passdb_module *
{
struct passdb_module *module;
else if (*args != '\0')
return module;
}
{
endspent();
}
struct passdb_module_interface passdb_shadow = {
"shadow",
NULL,
};
#else
struct passdb_module_interface passdb_shadow = {
.name = "shadow"
};
#endif