userdb-nss.c revision 312d3129573fc63ba0d39105b68daccfab9f0c8f
/* Copyright (c) 2007-2009 Dovecot authors, see the included COPYING file */
/* Currently supports only GLIBC-compatible NSS modules */
#include "common.h"
#include "userdb.h"
#ifdef USERDB_NSS
#include "module-dir.h"
#include <pwd.h>
#include <unistd.h>
#include <dlfcn.h>
#include <nss.h>
#define USER_CACHE_KEY "%u"
struct nss_userdb_module {
struct userdb_module module;
char *buf;
struct module nss_module;
};
static void
{
enum nss_status status;
int err;
switch (status) {
case NSS_STATUS_TRYAGAIN:
"returned tryagain (err=%d)", err);
break;
case NSS_STATUS_UNAVAIL:
"unavailable (err=%d)", err);
break;
case NSS_STATUS_NOTFOUND:
break;
case NSS_STATUS_SUCCESS:
break;
default:
break;
}
if (result != USERDB_RESULT_OK) {
return;
}
}
static void
{
char *path;
module->getpwnam_r =
}
static struct userdb_module *
{
struct nss_userdb_module *module;
const char *const *tmp;
else
}
i_fatal("userdb nss: Missing service");
}
{
void (*mod_endpwent)(void);
const char *symbol;
if (mod_endpwent != NULL)
mod_endpwent();
}
struct userdb_module_interface userdb_nss = {
"nss",
NULL,
};
#else
struct userdb_module_interface userdb_nss = {
};
#endif