db-ldap.h revision 4261a8b43792dc4db4b39e6910319835b7450e84
#ifndef __DB_LDAP_H
#define __DB_LDAP_H
/* Functions like ldap_bind() have been deprecated in OpenLDAP 2.3
This define enables them until the code here can be refactored */
#define LDAP_DEPRECATED 1
#include <ldap.h>
struct auth_request;
struct ldap_connection;
struct ldap_request;
struct ldap_request *request,
LDAPMessage *res);
struct ldap_settings {
const char *hosts;
const char *uris;
const char *dn;
const char *dnpass;
bool auth_bind;
const char *auth_bind_userdn;
bool tls;
bool sasl_bind;
const char *sasl_mech;
const char *sasl_realm;
const char *sasl_authz_id;
const char *deref;
const char *scope;
const char *base;
unsigned int ldap_version;
const char *user_attrs;
const char *user_filter;
const char *pass_attrs;
const char *pass_filter;
const char *default_pass_scheme;
/* ... */
int ldap_deref, ldap_scope;
};
struct ldap_connection {
struct ldap_connection *next;
int refcount;
char *config_path;
struct ldap_settings set;
int fd; /* only set when connected/connecting */
struct hash_table *requests;
char **pass_attr_names, **user_attr_names;
unsigned int connected:1;
unsigned int connecting:1;
unsigned int binding:1;
unsigned int last_auth_bind:1;
};
struct ldap_request {
void *context;
/* for bind requests, base contains the DN and filter=NULL */
const char *base;
const char *filter;
char **attributes; /* points to pass_attr_names / user_attr_names */
};
struct ldap_sasl_bind_context {
const char *authcid;
const char *passwd;
const char *realm;
const char *authzid;
};
struct ldap_request *request);
int scope);
const char *const default_attr_map[],
const char *skip_attr);
struct var_expand_table *
const char *ldap_escape(const char *str,
const struct auth_request *auth_request);
struct db_ldap_result_iterate_context *
struct auth_request *auth_request,
struct hash_table *attr_map);
const char **name_r,
const char *const **values_r);
#endif