db-ldap.h revision 53e4a0d5cb048ea2bdf598ca56120b626b8615f5
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen/* Functions like ldap_bind() have been deprecated in OpenLDAP 2.3
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen This define enables them until the code here can be refactored */
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen/* Maximum number of pending requests before delaying new requests. */
96e1ed172ae59cae6bc6e6ddd24d22a158e23dfeTimo Sirainen/* connect() timeout to LDAP */
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen/* If LDAP connection is down, fail requests after waiting for this long. */
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen#define DB_LDAP_REQUEST_DISCONNECT_TIMEOUT_SECS 4
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen/* If request is still in queue after this many seconds and other requests
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen have been replied, assume the request was lost and abort it. */
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen/* If server disconnects us, don't reconnect if no requests have been sent
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen for this many seconds. */
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainentypedef void db_search_callback_t(struct ldap_connection *conn,
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen const char *dn;
96e1ed172ae59cae6bc6e6ddd24d22a158e23dfeTimo Sirainen bool userdb_warning_disable; /* deprecated for now at least */
b2ff0468c298dd2f525fff5977f1f24fba3a9f3bTimo Sirainen int ldap_deref, ldap_scope, ldap_tls_require_cert_parsed;
struct ldap_field {
const char *name;
const char *value;
const char *ldap_attr_name;
bool value_is_dn;
bool skip;
struct ldap_request {
int msgid;
struct ldap_request_named_result {
const char *dn;
struct ldap_request_search {
const char *base;
const char *filter;
unsigned int name_idx;
bool multi_entry;
struct ldap_request_bind {
const char *dn;
enum ldap_connection_state {
struct ldap_connection {
int refcount;
char *config_path;
int default_bind_msgid;
int fd;
unsigned int pending_count;
bool userdb_used;
bool delayed_connect;
struct db_ldap_result_iterate_context *
const char **name_r,
const char *const **values_r);