db-checkpassword.c revision fdfb2153df1841889c73a39f8cbb99f462781bd4
/* Copyright (c) 2004-2011 Dovecot authors, see the included COPYING file */
#include "auth-common.h"
#if defined(PASSDB_CHECKPASSWORD) || defined(USERDB_CHECKPASSWORD)
#include "var-expand.h"
#include "db-checkpassword.h"
static void env_put_extra_fields(const char *extra_fields)
{
const char *const *tmp;
const char *key, *p;
if (p == NULL)
else
}
}
{
i_error("checkpassword: close() failed: %m");
}
i_error("checkpassword: close() failed: %m");
}
}
{
}
}
struct chkpw_auth_request *request)
{
i_error("checkpassword: sighandler called for unknown child %s",
return SIGCHLD_RESULT_UNKNOWN_CHILD;
}
if (WIFSIGNALED(status)) {
i_error("checkpassword: Child %s died with signal %d",
return SIGCHLD_RESULT_DEAD_CHILD;
"checkpassword", "exit_status=%d",
return SIGCHLD_RESULT_OK;
} else {
/* shouldn't happen */
"Child exited with status=%d", status);
return SIGCHLD_RESULT_UNKNOWN_ERROR;
}
}
{
const struct var_expand_table *tab;
unsigned int i;
}
}
}
{
/* Besides passing the standard username and password in a
pipe, also pass some other possibly interesting information
/* FIXME: for backwards compatibility only,
remove some day */
}
/* FIXME: for backwards compatibility only,
remove some day */
}
if (request->local_port != 0) {
request->local_port));
}
if (request->remote_port != 0) {
request->remote_port));
}
}
const char *fields =
/* extra fields could come from master db */
}
}
const char *
const char *checkpassword_reply_path)
{
}
{
unsigned char buf[1024];
if (ret <= 0) {
if (ret < 0) {
"checkpassword", "read() failed: %m");
}
"Received no input");
} else {
}
}
{
/* Send: username \0 password \0 timestamp \0.
Must be 512 bytes or less. The "timestamp" parameter is actually
useful only for APOP authentication. We don't support it, so
keep it empty */
const unsigned char *data;
else
if (size > 512) {
return;
}
if (ret <= 0) {
if (ret < 0) {
"checkpassword", "write() failed: %m");
}
return;
}
return;
i_error("checkpassword: close() failed: %m");
}
#endif