passdb.h revision 43a66a0b16299bd4f7615acd85e98bd3832c54d5
#ifndef __PASSDB_H
#define __PASSDB_H
#define IS_VALID_PASSWD(pass) \
struct auth_request;
enum passdb_result {
PASSDB_RESULT_OK = 1
};
struct auth_request *request);
const unsigned char *credentials,
struct auth_request *request);
struct auth_request *request);
struct passdb_module_interface {
const char *name;
struct passdb_module *
/* Check if plaintext password matches */
/* Return authentication credentials, set in
auth_request->credentials. */
/* Update credentials */
const char *new_credentials,
};
struct passdb_module {
/* The caching key for this module, or NULL if caching isn't wanted. */
const char *cache_key;
/* Default password scheme for this module.
If cache_key is set, must not be NULL. */
const char *default_pass_scheme;
/* If blocking is set to TRUE, use child processes to access
this passdb. */
bool blocking;
struct passdb_module_interface iface;
};
/* 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);
void passdbs_init(void);
void passdbs_deinit(void);
#include "auth-request.h"
#endif