/*% checks that the LDAP URL parameters make sense */
static isc_result_t
-ldap_checkURL(ldap_instance_t *db, char *URL, int attrCnt, const char *msg) {
+dlz_ldap_checkURL(ldap_instance_t *db, char *URL, int attrCnt,
+ const char *msg) {
isc_result_t result = ISC_R_SUCCESS;
int ldap_result;
LDAPURLDesc *ldap_url = NULL;
* multithreaded operation.
*/
static void
-ldap_destroy_dblist(db_list_t *dblist) {
+dlz_ldap_destroy_dblist(db_list_t *dblist) {
dbinstance_t *ndbi = NULL;
dbinstance_t *dbi = NULL;
* multithreaded operation.
*/
static dbinstance_t *
-ldap_find_avail_conn(ldap_instance_t *ldap) {
+dlz_ldap_find_avail_conn(ldap_instance_t *ldap) {
dbinstance_t *dbi = NULL;
dbinstance_t *head;
int count = 0;
#endif /* PTHREADS */
static isc_result_t
-ldap_process_results(ldap_instance_t *db, LDAP *dbc, LDAPMessage *msg,
- char **attrs, void *ptr, bool allnodes) {
+dlz_ldap_process_results(ldap_instance_t *db, LDAP *dbc, LDAPMessage *msg,
+ char **attrs, void *ptr, bool allnodes) {
isc_result_t result = ISC_R_SUCCESS;
int i = 0;
int j;
* obtain a result set.
*/
static isc_result_t
-ldap_get_results(const char *zone, const char *record, const char *client,
- unsigned int query, void *dbdata, void *ptr) {
+dlz_ldap_get_results(const char *zone, const char *record, const char *client,
+ unsigned int query, void *dbdata, void *ptr) {
isc_result_t result;
ldap_instance_t *db = (ldap_instance_t *)dbdata;
dbinstance_t *dbi = NULL;
/* get db instance / connection */
#if PTHREADS
/* find an available DBI from the list */
- dbi = ldap_find_avail_conn(db);
+ dbi = dlz_ldap_find_avail_conn(db);
#else /* PTHREADS */
/*
* only 1 DBI - no need to lock instance lock either
* screwed up!
*/
db->log(ISC_LOG_ERROR, "Incorrect query flag passed to "
- "ldap_get_results");
+ "dlz_ldap_get_results");
result = ISC_R_UNEXPECTED;
goto cleanup;
}
switch (query) {
case ALLNODES:
- result = ldap_process_results(db, (LDAP *)dbi->dbconn, ldap_msg,
- ldap_url->lud_attrs, ptr, true);
+ result = dlz_ldap_process_results(db, (LDAP *)dbi->dbconn,
+ ldap_msg, ldap_url->lud_attrs,
+ ptr, true);
break;
case AUTHORITY:
case LOOKUP:
- result = ldap_process_results(db, (LDAP *)dbi->dbconn, ldap_msg,
- ldap_url->lud_attrs, ptr, false);
+ result = dlz_ldap_process_results(db, (LDAP *)dbi->dbconn,
+ ldap_msg, ldap_url->lud_attrs,
+ ptr, false);
break;
case ALLOWXFR:
entries = ldap_count_entries((LDAP *)dbi->dbconn, ldap_msg);
* screwed up!
*/
db->log(ISC_LOG_ERROR, "Incorrect query flag passed to "
- "ldap_get_results");
+ "dlz_ldap_get_results");
result = ISC_R_UNEXPECTED;
}
}
/* get all the zone data */
- result = ldap_get_results(name, NULL, client, ALLOWXFR, dbdata, NULL);
+ result = dlz_ldap_get_results(name, NULL, client, ALLOWXFR, dbdata,
+ NULL);
return (result);
}
isc_result_t
dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
- return (ldap_get_results(zone, NULL, NULL, ALLNODES, dbdata, allnodes));
+ return (dlz_ldap_get_results(zone, NULL, NULL, ALLNODES, dbdata,
+ allnodes));
}
isc_result_t
dlz_authority(const char *zone, void *dbdata, dns_sdlzlookup_t *lookup) {
- return (ldap_get_results(zone, NULL, NULL, AUTHORITY, dbdata, lookup));
+ return (dlz_ldap_get_results(zone, NULL, NULL, AUTHORITY, dbdata,
+ lookup));
}
#if DLZ_DLOPEN_VERSION < 3
UNUSED(methods);
UNUSED(clientinfo);
#endif /* if DLZ_DLOPEN_VERSION >= 3 */
- return (ldap_get_results(name, NULL, NULL, FINDZONE, dbdata, NULL));
+ return (dlz_ldap_get_results(name, NULL, NULL, FINDZONE, dbdata, NULL));
}
#if DLZ_DLOPEN_VERSION == 1
#endif /* if DLZ_DLOPEN_VERSION >= 2 */
if (strcmp(name, "*") == 0) {
- result = ldap_get_results(zone, "~", NULL, LOOKUP, dbdata,
- lookup);
+ result = dlz_ldap_get_results(zone, "~", NULL, LOOKUP, dbdata,
+ lookup);
} else {
- result = ldap_get_results(zone, name, NULL, LOOKUP, dbdata,
- lookup);
+ result = dlz_ldap_get_results(zone, name, NULL, LOOKUP, dbdata,
+ lookup);
}
return (result);
}
/* check that LDAP URL parameters make sense */
switch (argc) {
case 12:
- result = ldap_checkURL(ldap, argv[11], 0,
- "allow zone transfer");
+ result = dlz_ldap_checkURL(ldap, argv[11], 0,
+ "allow zone transfer");
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
case 11:
- result = ldap_checkURL(ldap, argv[10], 3, "all nodes");
+ result = dlz_ldap_checkURL(ldap, argv[10], 3, "all nodes");
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
case 10:
if (strlen(argv[9]) > 0) {
- result = ldap_checkURL(ldap, argv[9], 3, "authority");
+ result = dlz_ldap_checkURL(ldap, argv[9], 3,
+ "authority");
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
}
case 9:
- result = ldap_checkURL(ldap, argv[8], 3, "lookup");
+ result = dlz_ldap_checkURL(ldap, argv[8], 3, "lookup");
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
- result = ldap_checkURL(ldap, argv[7], 0, "find zone");
+ result = dlz_ldap_checkURL(ldap, argv[7], 0, "find zone");
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
#if PTHREADS
/* cleanup the list of DBI's */
if (db->db != NULL) {
- ldap_destroy_dblist((db_list_t *)(db->db));
+ dlz_ldap_destroy_dblist((db_list_t *)(db->db));
}
#else /* PTHREADS */
if (db->db->dbconn != NULL) {