158 cxstring memberType = serverconfig_object_directive_value(node, cx_str("MemberType")); |
159 cxstring memberType = serverconfig_object_directive_value(node, cx_str("MemberType")); |
159 cxstring enableGroups = serverconfig_object_directive_value(node, cx_str("EnableGroups")); |
160 cxstring enableGroups = serverconfig_object_directive_value(node, cx_str("EnableGroups")); |
160 cxstring userNameIsDn = serverconfig_object_directive_value(node, cx_str("UserNameIsDn")); |
161 cxstring userNameIsDn = serverconfig_object_directive_value(node, cx_str("UserNameIsDn")); |
161 |
162 |
162 if(!resource.ptr) { |
163 if(!resource.ptr) { |
163 // TODO: create resource pool |
164 // implicitly create a resource pool for this authdb |
|
165 cxmutstr respool_name = cx_asprintf_a(cfg->a, "_authdb_%s", name); |
|
166 if(!respool_name.ptr) { |
|
167 return NULL; |
|
168 } |
|
169 log_ereport( |
|
170 LOG_INFORM, |
|
171 "ldap authdb %s: no resource specified: create resource pool %s", |
|
172 name, |
|
173 respool_name.ptr); |
|
174 if(resourcepool_new(cfg, cx_str("ldap"), cx_strcast(respool_name), node)) { |
|
175 log_ereport( |
|
176 LOG_FAILURE, |
|
177 "ldap authdb %s: cannot create ldap resource pool", |
|
178 name); |
|
179 return NULL; |
|
180 } |
|
181 authdb->config.resource = respool_name.ptr; |
164 } else { |
182 } else { |
165 authdb->config.resource = cx_strdup_a(cfg->a, resource).ptr; |
183 authdb->config.resource = cx_strdup_a(cfg->a, resource).ptr; |
166 if(!authdb->config.resource) return NULL; |
184 if(!authdb->config.resource) return NULL; |
167 } |
185 } |
168 |
186 |