#include <ctype.h>#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/time.h>#include <ldap.h>#include <atalk/logger.h>#include <atalk/afp.h>#include <atalk/uuid.h>#include <atalk/ldapconfig.h>#include <atalk/errchk.h>Macros | |
| #define | LDAP_DEPRECATED 1 |
| #define | MAX_FILTER_SIZE 512 |
| #define | LDAP_BIN_UUID_LEN 49 |
Enumerations | |
| enum | ldapcon_t { KEEPALIVE = 1 } |
Functions | |
| static int | ldap_getattr_fromfilter_withbase_scope (const char *searchbase, const char *filter, char *attributes[], int scope, ldapcon_t conflags, char **result) |
| LDAP get attribute from filter with base and scope. | |
| static char * | gen_uuid_filter (const char *uuidstr_in, const char *attr_filter) |
| Generate LDAP filter string for UUID query. | |
| int | ldap_getuuidfromname (const char *name, uuidtype_t type, char **uuid_string) |
| Search UUID for name in LDAP. | |
| int | ldap_getnamefromuuid (const char *uuidstr, char **name, uuidtype_t *type) |
| LDAP search wrapper. | |
Variables | |
| int | ldap_config_valid |
| char * | ldap_uri |
| int | ldap_auth_method |
| char * | ldap_auth_dn |
| char * | ldap_auth_pw |
| char * | ldap_userbase |
| int | ldap_userscope |
| char * | ldap_groupbase |
| int | ldap_groupscope |
| char * | ldap_uuid_attr |
| char * | ldap_uuid_string |
| char * | ldap_name_attr |
| char * | ldap_group_attr |
| char * | ldap_uid_attr |
| char * | ldap_userfilter |
| char * | ldap_groupfilter |
| int | ldap_uuid_encoding |
| struct ldap_pref | ldap_prefs [] |
| struct pref_array | prefs_array [] |
| #define LDAP_BIN_UUID_LEN 49 |
| #define LDAP_DEPRECATED 1 |
| #define MAX_FILTER_SIZE 512 |
| enum ldapcon_t |
|
static |
Generate LDAP filter string for UUID query.
| [in] | uuidstr_in | the UUID as string |
| [in] | attr_filter | optional attribute |
|
static |
LDAP get attribute from filter with base and scope.
| searchbase | Base DN for LDAP search |
| filter | LDAP search filter |
| attributes | Array of attribute names to retrieve |
| scope | Search scope (LDAP_SCOPE_BASE, LDAP_SCOPE_ONELEVEL, LDAP_SCOPE_SUBTREE) |
| conflags | Connection flags (KEEPALIVE) |
| result | unique search result, allocated here, caller must free |
All connection managment to the LDAP server is done here. Just set KEEPALIVE if you know you will be dispatching more than one search in a row, then don't set it with the last search. You MUST dispatch the queries timely, otherwise the LDAP handle might timeout.
| int ldap_getnamefromuuid | ( | const char * | uuidstr, |
| char ** | name, | ||
| uuidtype_t * | type ) |
LDAP search wrapper.
returns allocated storage in name, caller must free it
| [in] | uuidstr | uuid to search as ascii string |
| [out] | name | return pointer to name as allocated string |
| [out] | type | return type: USER or GROUP |
| int ldap_getuuidfromname | ( | const char * | name, |
| uuidtype_t | type, | ||
| char ** | uuid_string ) |
Search UUID for name in LDAP.
Caller must free uuid_string when done with it
| [in] | name | name to search |
| [in] | type | type of USER or GROUP |
| [out] | uuid_string | result as pointer to allocated UUID-string |
| char* ldap_auth_dn |
| int ldap_auth_method |
| char* ldap_auth_pw |
| int ldap_config_valid |
| char* ldap_group_attr |
| char* ldap_groupbase |
| char* ldap_groupfilter |
| int ldap_groupscope |
| char* ldap_name_attr |
| struct ldap_pref ldap_prefs[] |
| char* ldap_uid_attr |
| char* ldap_uri |
| char* ldap_userbase |
| char* ldap_userfilter |
| int ldap_userscope |
| char* ldap_uuid_attr |
| int ldap_uuid_encoding |
| char* ldap_uuid_string |
| struct pref_array prefs_array[] |