/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "auth-common.h"
#include "userdb.h"
#ifdef USERDB_PASSWD
#include "ioloop.h"
#include "ipwd.h"
#include "time-util.h"
#include "userdb-template.h"
struct passwd_userdb_module {
};
struct passwd_userdb_iterate_context {
};
static void
struct passwd_userdb_module *module,
{
return;
if (msecs >= PASSWD_SLOW_WARN_MSECS) {
i_warning("passwd: Lookup for %s took %u secs",
return;
}
return;
if (msecs < PASSWD_SLOW_MASTER_WARN_MSECS) {
module->fast_count++;
return;
}
module->slow_count++;
return;
/* start from beginning */
} else {
i_warning("passwd: %u%% of last %u lookups took over "
"%u milliseconds, "
"you may want to set blocking=yes for userdb",
}
}
{
(struct passwd_userdb_module *)_module;
const char *error;
int ret;
switch (ret) {
case -1:
"getpwnam() failed: %m");
return;
case 0:
return;
}
"Failed to expand template: %s", error);
}
}
static struct userdb_iterate_context *
{
setpwent();
if (cur_userdb_iter == NULL)
}
static bool
{
/* skip entries not in valid UID range.
they're users for daemons and such. */
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
}
{
(struct passwd_userdb_iterate_context *)_ctx;
/* we can't support concurrent userdb iteration.
wait until the previous one is done */
return;
}
errno = 0;
return;
}
}
if (errno != 0) {
i_error("getpwent() failed: %m");
}
}
static void ATTR_NULL(1)
{
}
{
(struct passwd_userdb_iterate_context *)_ctx;
if (cur_userdb_iter != NULL) {
NULL);
}
return ret;
}
static struct userdb_module *
{
const char *value;
/* FIXME: backwards compatibility */
i_warning("userdb passwd: Move templates args to override_fields setting");
}
"passwd",
NULL,
NULL,
};
#else
.name = "passwd"
};
#endif