# HG changeset patch # User Olaf Wintermann # Date 1678539450 -3600 # Node ID 4fd523fff13bd89f274ee699990af603e1367f0a # Parent 72848970541afa2620a4943304368e620868a2b6 add option to automatically bind new ldap sessions diff -r 72848970541a -r 4fd523fff13b src/server/daemon/ldap_resource.c --- a/src/server/daemon/ldap_resource.c Sat Mar 11 12:37:48 2023 +0100 +++ b/src/server/daemon/ldap_resource.c Sat Mar 11 13:57:30 2023 +0100 @@ -124,7 +124,17 @@ char *bindpw = pblock_findval("Bindpw", pb); char *bind = pblock_findval("Bind", pb); - if(!ldap_uri || !host) { + log_ereport( + LOG_INFORM, + "create ldap resource pool: name=%s : %s%s%s%s : binddn=%s", + rpname, + ldap_uri ? "uri=" : "host=", + ldap_uri ? ldap_uri : host, + ldap_uri || !port ? "" : ":", + !port ? "" : port, + binddn ? binddn : "''"); + + if(!ldap_uri && !host) { log_ereport(LOG_MISCONFIG, "Resource pool %s: No host or ldap uri specified", rpname); return NULL; } @@ -160,7 +170,8 @@ ldap_pool->port = (int)port_i; ldap_pool->binddn = binddn; ldap_pool->bindpw = bindpw; - ldap_pool->bind = util_getboolean(bind, ldap_pool->binddn != NULL); + WSBool bind_def = binddn != NULL; + ldap_pool->bind = bind ? util_getboolean(bind, bind_def) : bind_def; return ldap_pool; } diff -r 72848970541a -r 4fd523fff13b src/server/daemon/resourcepool.c --- a/src/server/daemon/resourcepool.c Sat Mar 11 12:37:48 2023 +0100 +++ b/src/server/daemon/resourcepool.c Sat Mar 11 13:57:30 2023 +0100 @@ -146,6 +146,8 @@ if(createResource) { // create a new resource and store it in the resourcepool + log_ereport(LOG_DEBUG, "resourcepool %s: create resource", name); + void *resourceData = respool->type->createresource(respool->data); if(resourceData) { respool->numcreated++;