view src/auth/userdb.h @ 2754:3c3ac12be307 HEAD

Created generic asynchronous SQL API and implemented MySQL and PostgreSQL drivers. MySQL is implemented synchronously because it's API doesn't provide async way to do it. Replaced pgsql and mysql userdb/passdb with generic sql userdb/passdb.
author Timo Sirainen <tss@iki.fi>
date Sat, 16 Oct 2004 02:12:51 +0300
parents 0f31778d3c34
children c7d426f8cb58
line wrap: on
line source

#ifndef __USERDB_H
#define __USERDB_H

#include "mech.h"

struct user_data {
	const char *virtual_user;
	const char *home;
	const char *mail;

	const char *system_user;
	uid_t uid;
	gid_t gid;
};

typedef void userdb_callback_t(const struct user_data *user, void *context);

struct userdb_module {
	void (*preinit)(const char *args);
	void (*init)(const char *args);
	void (*deinit)(void);

	void (*lookup)(struct auth_request *auth_request,
		       userdb_callback_t *callback, void *context);
};

extern struct userdb_module *userdb;

extern struct userdb_module userdb_static;
extern struct userdb_module userdb_passwd;
extern struct userdb_module userdb_passwd_file;
extern struct userdb_module userdb_vpopmail;
extern struct userdb_module userdb_ldap;
extern struct userdb_module userdb_sql;

void userdb_preinit(void);
void userdb_init(void);
void userdb_deinit(void);

#endif