userdb-ldap.c revision afa2af53ff06152efa65f6cc0e54fb1eb319d2fd
/* Copyright (C) 2003 Timo Sirainen */
#include "config.h"
#ifdef USERDB_LDAP
#include "common.h"
#include "str.h"
#include "var-expand.h"
#include "db-ldap.h"
#include "userdb.h"
#include <ldap.h>
#include <stdlib.h>
/* using posixAccount */
#define DEFAULT_ATTRIBUTES "uid,homeDirectory,,,uidNumber,gidNumber"
enum ldap_user_attr {
ATTR_VIRTUAL_USER = 0,
};
struct userdb_ldap_connection {
struct ldap_connection *conn;
unsigned int *attrs;
char **attr_names;
};
struct userdb_ldap_request {
struct ldap_request request;
struct auth_request *auth_request;
};
static struct userdb_ldap_connection *userdb_ldap_conn;
struct userdb_ldap_connection *conn,
{
enum ldap_user_attr i;
for (i = 0; i < ATTR_COUNT; i++) {
break;
}
if (i == ATTR_COUNT) {
"Unknown attribute '%s'", attr);
return;
}
case ATTR_VIRTUAL_USER:
break;
case ATTR_HOME:
break;
case ATTR_MAIL:
break;
case ATTR_SYSTEM_USER:
break;
case ATTR_UID_NUMBER:
break;
case ATTR_GID_NUMBER:
break;
case ATTR_COUNT:
break;
}
}
{
struct userdb_ldap_request *urequest =
(struct userdb_ldap_request *) request;
int ret;
if (ret != LDAP_SUCCESS) {
return;
}
"Authenticated user not found");
}
return;
}
t_push();
}
}
"No username in reply");
"uidNumber not set and no default given in "
"user_global_uid");
"gidNumber not set and no default given in "
"user_global_gid");
"Multiple replies found for user");
} else {
t_pop();
return;
}
/* error */
t_pop();
}
{
const struct var_expand_table *vars;
struct userdb_ldap_request *request;
} else {
}
"base=%s scope=%s filter=%s fields=%s",
}
static void userdb_ldap_preinit(const char *args)
{
struct ldap_connection *conn;
}
{
}
static void userdb_ldap_deinit(void)
{
}
struct userdb_module userdb_ldap = {
"ldap",
};
#endif