userdb-passwd.c revision a7f5035eebbd138a5436a2eb2ce1fa5fd3d269fb
/* Copyright (c) 2002-2010 Dovecot authors, see the included COPYING file */
#include "auth-common.h"
#include "userdb.h"
#ifdef USERDB_PASSWD
#include "ioloop.h"
#include "userdb-static.h"
#include <pwd.h>
#define USER_CACHE_KEY "%u"
struct passwd_userdb_module {
struct userdb_module module;
struct userdb_static_template *tmpl;
};
struct passwd_userdb_iterate_context {
struct userdb_iterate_context ctx;
const struct auth_settings *set;
};
{
struct passwd_userdb_module *module =
(struct passwd_userdb_module *)_module;
return;
}
/* FIXME: the system_user is for backwards compatibility */
"system_groups_user",
}
}
}
}
static struct userdb_iterate_context *
{
struct passwd_userdb_iterate_context *ctx;
setpwent();
if (cur_userdb_iter == NULL)
}
{
struct passwd_userdb_iterate_context *ctx =
(struct passwd_userdb_iterate_context *)_ctx;
/* we can't support concurrent userdb iteration.
wait until the previous one is done */
return;
}
errno = 0;
/* skip entries not in valid UID range.
they're users for daemons and such. */
return;
}
}
if (errno != 0) {
i_error("getpwent() failed: %m");
}
}
{
}
{
struct passwd_userdb_iterate_context *ctx =
(struct passwd_userdb_iterate_context *)_ctx;
if (cur_userdb_iter != NULL) {
}
return ret;
}
static struct userdb_module *
{
struct passwd_userdb_module *module;
const char *value;
&value)) {
}
}
struct userdb_module_interface userdb_passwd = {
"passwd",
NULL,
NULL,
};
#else
struct userdb_module_interface userdb_passwd = {
.name = "passwd"
};
#endif