userdb-static.c revision 45312f52ff3a3d4c137447be4c7556500c2f8bf2
/* Copyright (c) 2003-2009 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "array.h"
#include "str.h"
#include "var-expand.h"
#include "userdb.h"
#include "userdb-static.h"
#include <stdlib.h>
struct userdb_static_template {
ARRAY_DEFINE(args, const char *);
};
struct userdb_static_template *
const char *args)
{
struct userdb_static_template *tmpl;
else {
value++;
}
i_fatal("%s userdb: Invalid uid: %s",
userdb_name, value);
}
i_fatal("%s userdb: Invalid gid: %s",
userdb_name, value);
}
} else if (*key == '\0') {
i_fatal("%s userdb: Empty key (=%s)",
userdb_name, value);
}
}
return tmpl;
}
const char *key)
{
const char *const *args;
unsigned int i, count;
for (i = 0; i < count; i += 2) {
return TRUE;
}
return FALSE;
}
{
const char *const *args;
unsigned int i, count;
for (i = 0; i < count; i += 2) {
return TRUE;
}
}
return FALSE;
}
struct auth_request *auth_request)
{
const struct var_expand_table *table;
unsigned int i, count;
for (i = 0; i < count; i += 2) {
else {
str_truncate(str, 0);
}
}
}
#ifdef USERDB_STATIC
struct static_context {
void *old_context;
};
struct static_userdb_module {
struct userdb_module module;
struct userdb_static_template *tmpl;
unsigned int allow_all_users:1;
};
{
struct static_userdb_module *module =
(struct static_userdb_module *)_module;
}
static void
const unsigned char *credentials ATTR_UNUSED,
struct auth_request *auth_request)
{
switch (result) {
case PASSDB_RESULT_OK:
break;
break;
"passdb doesn't support lookups, "
"can't verify user's existence");
/* fall through */
default:
break;
}
}
{
struct static_userdb_module *module =
(struct static_userdb_module *)_module;
struct static_context *ctx;
/* this is a userdb-only lookup. we need to know if this
users exists or not. use a passdb lookup to do that.
if the passdb doesn't support returning credentials, this
will of course fail.. */
} else {
}
}
static struct userdb_module *
{
struct static_userdb_module *module;
const char *value;
"static", args);
&value)) {
}
}
struct userdb_module_interface userdb_static = {
"static",
NULL,
NULL,
};
#else
struct userdb_module_interface userdb_static = {
};
#endif