#ifndef PASSDB_H
#define PASSDB_H
#include "md5.h"
struct auth_request;
struct auth_passdb_settings;
enum passdb_result {
};
struct auth_request *request);
const unsigned char *credentials,
struct auth_request *request);
struct auth_request *request);
struct passdb_module_interface {
const char *name;
/* Check if plaintext password matches */
/* Return authentication credentials, set in
auth_request->credentials. */
/* Update credentials */
const char *new_credentials,
};
struct passdb_module {
const char *args;
/* The default caching key for this module, or NULL if caching isn't
wanted. This is updated by settings in auth_passdb. */
const char *default_cache_key;
/* Default password scheme for this module.
If default_cache_key is set, must not be NULL. */
const char *default_pass_scheme;
/* Supported authentication mechanisms, NULL is all, [NULL] is none*/
const char *const *mechanisms;
/* Username filter, NULL is no filter */
const char *const *username_filter;
/* If blocking is set to TRUE, use child processes to access
this passdb. */
bool blocking;
/* id is used by blocking passdb to identify the passdb */
unsigned int id;
/* number of time init() has been called */
int init_refcount;
/* WARNING: avoid adding anything here that isn't based on args.
if you do, you need to change passdb.c:passdb_find() also to avoid
accidentally merging wrong passdbs. */
};
/* Try to get credentials in wanted scheme (request->credentials_scheme) from
given input. Returns FALSE if this wasn't possible (unknown scheme,
conversion not possible or invalid credentials).
If wanted scheme is "", the credentials are returned as-is without any
checks. This is useful mostly just to see if there exist any credentials
at all. */
const char *input, const char *input_scheme,
const unsigned char **credentials_r,
struct auth_request *auth_request);
struct passdb_module *
void passdbs_init(void);
void passdbs_deinit(void);
#include "auth-request.h"
#endif