openldap: tell libldap to automatically restart reconnections
[collectd.git] / src / openldap.c
1 /**
2  * collectd - src/openldap.c
3  * Copyright (C) 2011       Kimo Rosenbaum
4  * Copyright (C) 2014       Marc Fournier
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  *
24  * Authors:
25  *   Kimo Rosenbaum <kimor79 at yahoo.com>
26  *   Marc Fournier <marc.fournier at camptocamp.com>
27  **/
28
29 #include "collectd.h"
30 #include "common.h"
31 #include "plugin.h"
32 #include "configfile.h"
33
34 #include <lber.h>
35 #include <ldap.h>
36
37 struct cldap_s /* {{{ */
38 {
39         char *name;
40
41         char *binddn;
42         char *password;
43         char *cacert;
44         char *host;
45         int   state;
46         _Bool starttls;
47         int   timeout;
48         char *url;
49         _Bool verifyhost;
50         int   version;
51
52         LDAP *ld;
53 };
54 typedef struct cldap_s cldap_t; /* }}} */
55
56 static void cldap_free (cldap_t *st) /* {{{ */
57 {
58         if (st == NULL)
59                 return;
60
61         sfree (st->binddn);
62         sfree (st->password);
63         sfree (st->cacert);
64         sfree (st->host);
65         sfree (st->name);
66         sfree (st->url);
67         if (st->ld)
68                 ldap_memfree (st->ld);
69         sfree (st);
70 } /* }}} void cldap_free */
71
72 /* initialize ldap for each host */
73 static int cldap_init_host (cldap_t *st) /* {{{ */
74 {
75         LDAP *ld;
76         int rc;
77
78         if (st->state && st->ld)
79         {
80                 DEBUG ("openldap plugin: Already connected to %s", st->url);
81                 return (0);
82         }
83
84         rc = ldap_initialize (&ld, st->url);
85         if (rc != LDAP_SUCCESS)
86         {
87                 ERROR ("openldap plugin: ldap_initialize failed: %s",
88                         ldap_err2string (rc));
89                 st->state = 0;
90                 ldap_unbind_ext_s (ld, NULL, NULL);
91                 return (-1);
92         }
93
94         st->ld = ld;
95
96         ldap_set_option (st->ld, LDAP_OPT_PROTOCOL_VERSION, &st->version);
97
98         ldap_set_option (st->ld, LDAP_OPT_TIMEOUT,
99                 &(const struct timeval){st->timeout, 0});
100
101         ldap_set_option (st->ld, LDAP_OPT_RESTART, LDAP_OPT_ON);
102
103         if (st->cacert != NULL)
104                 ldap_set_option (st->ld, LDAP_OPT_X_TLS_CACERTFILE, st->cacert);
105
106         if (st->verifyhost == 0)
107         {
108                 int never = LDAP_OPT_X_TLS_NEVER;
109                 ldap_set_option (st->ld, LDAP_OPT_X_TLS_REQUIRE_CERT, &never);
110         }
111
112         if (st->starttls != 0)
113         {
114                 rc = ldap_start_tls_s (ld, NULL, NULL);
115                 if (rc != LDAP_SUCCESS)
116                 {
117                         ERROR ("openldap plugin: Failed to start tls on %s: %s",
118                                         st->url, ldap_err2string (rc));
119                         st->state = 0;
120                         ldap_unbind_ext_s (st->ld, NULL, NULL);
121                         return (-1);
122                 }
123         }
124
125         struct berval cred;
126         if (st->password != NULL)
127         {
128                 cred.bv_val = st->password;
129                 cred.bv_len = strlen (st->password);
130         }
131         else
132         {
133                 cred.bv_val = "";
134                 cred.bv_len = 0;
135         }
136
137         rc = ldap_sasl_bind_s (st->ld, st->binddn, LDAP_SASL_SIMPLE, &cred, 
138                         NULL, NULL, NULL);
139         if (rc != LDAP_SUCCESS)
140         {
141                 ERROR ("openldap plugin: Failed to bind to %s: %s",
142                                 st->url, ldap_err2string (rc));
143                 st->state = 0;
144                 ldap_unbind_ext_s (st->ld, NULL, NULL);
145                 return (-1);
146         }
147         else
148         {
149                 DEBUG ("openldap plugin: Successfully connected to %s",
150                                 st->url);
151                 st->state = 1;
152                 return (0);
153         }
154 } /* }}} static cldap_init_host */
155
156 static void cldap_submit_value (const char *type, const char *type_instance, /* {{{ */
157                 value_t value, cldap_t *st)
158 {
159         value_list_t vl = VALUE_LIST_INIT;
160
161         vl.values     = &value;
162         vl.values_len = 1;
163
164         if ((st->host == NULL)
165                         || (strcmp ("", st->host) == 0)
166                         || (strcmp ("localhost", st->host) == 0))
167         {
168                 sstrncpy (vl.host, hostname_g, sizeof (vl.host));
169         }
170         else
171         {
172                 sstrncpy (vl.host, st->host, sizeof (vl.host));
173         }
174
175         sstrncpy (vl.plugin, "openldap", sizeof (vl.plugin));
176         if (st->name != NULL)
177                 sstrncpy (vl.plugin_instance, st->name,
178                                 sizeof (vl.plugin_instance));
179
180         sstrncpy (vl.type, type, sizeof (vl.type));
181         if (type_instance != NULL)
182                 sstrncpy (vl.type_instance, type_instance,
183                                 sizeof (vl.type_instance));
184
185         plugin_dispatch_values (&vl);
186 } /* }}} void cldap_submit_value */
187
188 static void cldap_submit_derive (const char *type, const char *type_instance, /* {{{ */
189                 derive_t d, cldap_t *st)
190 {
191         value_t v;
192         v.derive = d;
193         cldap_submit_value (type, type_instance, v, st);
194 } /* }}} void cldap_submit_derive */
195
196 static void cldap_submit_gauge (const char *type, const char *type_instance, /* {{{ */
197                 gauge_t g, cldap_t *st)
198 {
199         value_t v;
200         v.gauge = g;
201         cldap_submit_value (type, type_instance, v, st);
202 } /* }}} void cldap_submit_gauge */
203
204 static int cldap_read_host (user_data_t *ud) /* {{{ */
205 {
206         cldap_t *st;
207         LDAPMessage *e, *result;
208         char *dn;
209         int rc;
210         int status;
211
212         char *attrs[9] = { "monitorCounter",
213                                 "monitorOpCompleted",
214                                 "monitorOpInitiated",
215                                 "monitoredInfo",
216                                 "olmBDBEntryCache",
217                                 "olmBDBDNCache",
218                                 "olmBDBIDLCache",
219                                 "namingContexts",
220                                 NULL };
221
222         if ((ud == NULL) || (ud->data == NULL))
223         {
224                 ERROR ("openldap plugin: cldap_read_host: Invalid user data.");
225                 return (-1);
226         }
227
228         st = (cldap_t *) ud->data;
229
230         status = cldap_init_host (st);
231         if (status != 0)
232                 return (-1);
233
234         rc = ldap_search_ext_s (st->ld, "cn=Monitor", LDAP_SCOPE_SUBTREE,
235                 "(|(!(cn=* *))(cn=Database*))", attrs, 0,
236                 NULL, NULL, NULL, 0, &result);
237
238         if (rc != LDAP_SUCCESS)
239         {
240                 ERROR ("openldap plugin: Failed to execute search: %s",
241                                 ldap_err2string (rc));
242                 ldap_msgfree (result);
243                 st->state = 0;
244                 ldap_unbind_ext_s (st->ld, NULL, NULL);
245                 return (-1);
246         }
247
248         for (e = ldap_first_entry (st->ld, result); e != NULL;
249                 e = ldap_next_entry (st->ld, e))
250         {
251                 if ((dn = ldap_get_dn (st->ld, e)) != NULL)
252                 {
253                         unsigned long long counter = 0;
254                         unsigned long long opc = 0;
255                         unsigned long long opi = 0;
256                         unsigned long long info = 0;
257
258                         struct berval counter_data;
259                         struct berval opc_data;
260                         struct berval opi_data;
261                         struct berval info_data;
262                         struct berval olmbdb_data;
263                         struct berval nc_data;
264
265                         struct berval **counter_list;
266                         struct berval **opc_list;
267                         struct berval **opi_list;
268                         struct berval **info_list;
269                         struct berval **olmbdb_list;
270                         struct berval **nc_list;
271
272                         if ((counter_list = ldap_get_values_len (st->ld, e,
273                                 "monitorCounter")) != NULL)
274                         {
275                                 counter_data = *counter_list[0];
276                                 counter = atoll (counter_data.bv_val);
277                         }
278
279                         if ((opc_list = ldap_get_values_len (st->ld, e,
280                                 "monitorOpCompleted")) != NULL)
281                         {
282                                 opc_data = *opc_list[0];
283                                 opc = atoll (opc_data.bv_val);
284                         }
285
286                         if ((opi_list = ldap_get_values_len (st->ld, e,
287                                 "monitorOpInitiated")) != NULL)
288                         {
289                                 opi_data = *opi_list[0];
290                                 opi = atoll (opi_data.bv_val);
291                         }
292
293                         if ((info_list = ldap_get_values_len (st->ld, e,
294                                 "monitoredInfo")) != NULL)
295                         {
296                                 info_data = *info_list[0];
297                                 info = atoll (info_data.bv_val);
298                         }
299
300                         if (strcmp (dn, "cn=Total,cn=Connections,cn=Monitor")
301                                         == 0)
302                         {
303                                 cldap_submit_derive ("total_connections", NULL,
304                                         counter, st);
305                         }
306                         else if (strcmp (dn,
307                                         "cn=Current,cn=Connections,cn=Monitor")
308                                         == 0)
309                         {
310                                 cldap_submit_gauge ("current_connections", NULL,
311                                         counter, st);
312                         }
313                         else if (strcmp (dn,
314                                         "cn=Operations,cn=Monitor") == 0)
315                         {
316                                 cldap_submit_derive ("operations",
317                                         "completed", opc, st);
318                                 cldap_submit_derive ("operations",
319                                         "initiated", opi, st);
320                         }
321                         else if (strcmp (dn,
322                                         "cn=Bind,cn=Operations,cn=Monitor")
323                                         == 0)
324                         {
325                                 cldap_submit_derive ("operations",
326                                         "bind-completed", opc, st);
327                                 cldap_submit_derive ("operations",
328                                         "bind-initiated", opi, st);
329                         }
330                         else if (strcmp (dn,
331                                         "cn=UnBind,cn=Operations,cn=Monitor")
332                                         == 0)
333                         {
334                                 cldap_submit_derive ("operations",
335                                         "unbind-completed", opc, st);
336                                 cldap_submit_derive ("operations",
337                                         "unbind-initiated", opi, st);
338                         }
339                         else if (strcmp (dn,
340                                         "cn=Search,cn=Operations,cn=Monitor")
341                                         == 0)
342                         {
343                                 cldap_submit_derive ("operations",
344                                         "search-completed", opc, st);
345                                 cldap_submit_derive ("operations",
346                                         "search-initiated", opi, st);
347                         }
348                         else if (strcmp (dn,
349                                         "cn=Compare,cn=Operations,cn=Monitor")
350                                         == 0)
351                         {
352                                 cldap_submit_derive ("operations",
353                                         "compare-completed", opc, st);
354                                 cldap_submit_derive ("operations",
355                                         "compare-initiated", opi, st);
356                         }
357                         else if (strcmp (dn,
358                                         "cn=Modify,cn=Operations,cn=Monitor")
359                                         == 0)
360                         {
361                                 cldap_submit_derive ("operations",
362                                         "modify-completed", opc, st);
363                                 cldap_submit_derive ("operations",
364                                         "modify-initiated", opi, st);
365                         }
366                         else if (strcmp (dn,
367                                         "cn=Modrdn,cn=Operations,cn=Monitor")
368                                         == 0)
369                         {
370                                 cldap_submit_derive ("operations",
371                                         "modrdn-completed", opc, st);
372                                 cldap_submit_derive ("operations",
373                                         "modrdn-initiated", opi, st);
374                         }
375                         else if (strcmp (dn,
376                                         "cn=Add,cn=Operations,cn=Monitor")
377                                         == 0)
378                         {
379                                 cldap_submit_derive ("operations",
380                                         "add-completed", opc, st);
381                                 cldap_submit_derive ("operations",
382                                         "add-initiated", opi, st);
383                         }
384                         else if (strcmp (dn,
385                                         "cn=Delete,cn=Operations,cn=Monitor")
386                                         == 0)
387                         {
388                                 cldap_submit_derive ("operations",
389                                         "delete-completed", opc, st);
390                                 cldap_submit_derive ("operations",
391                                         "delete-initiated", opi, st);
392                         }
393                         else if (strcmp (dn,
394                                         "cn=Abandon,cn=Operations,cn=Monitor")
395                                         == 0)
396                         {
397                                 cldap_submit_derive ("operations",
398                                         "abandon-completed", opc, st);
399                                 cldap_submit_derive ("operations",
400                                         "abandon-initiated", opi, st);
401                         }
402                         else if (strcmp (dn,
403                                         "cn=Extended,cn=Operations,cn=Monitor")
404                                         == 0)
405                         {
406                                 cldap_submit_derive ("operations",
407                                         "extended-completed", opc, st);
408                                 cldap_submit_derive ("operations",
409                                         "extended-initiated", opi, st);
410                         }
411                         else if ((strncmp (dn, "cn=Database", 11) == 0)
412                                 && ((nc_list = ldap_get_values_len
413                                                 (st->ld, e, "namingContexts")) != NULL))
414                         {
415                                 nc_data = *nc_list[0];
416                                 char typeinst[DATA_MAX_NAME_LEN];
417
418                                 if ((olmbdb_list = ldap_get_values_len (st->ld, e,
419                                         "olmBDBEntryCache")) != NULL)
420                                 {
421                                         olmbdb_data = *olmbdb_list[0];
422                                         ssnprintf (typeinst, sizeof (typeinst),
423                                                 "bdbentrycache-%s", nc_data.bv_val);
424                                         cldap_submit_gauge ("cache_size", typeinst,
425                                                 atoll (olmbdb_data.bv_val), st);
426                                         ldap_value_free_len (olmbdb_list);
427                                 }
428
429                                 if ((olmbdb_list = ldap_get_values_len (st->ld, e,
430                                         "olmBDBDNCache")) != NULL)
431                                 {
432                                         olmbdb_data = *olmbdb_list[0];
433                                         ssnprintf (typeinst, sizeof (typeinst),
434                                                 "bdbdncache-%s", nc_data.bv_val);
435                                         cldap_submit_gauge ("cache_size", typeinst,
436                                                 atoll (olmbdb_data.bv_val), st);
437                                         ldap_value_free_len (olmbdb_list);
438                                 }
439
440                                 if ((olmbdb_list = ldap_get_values_len (st->ld, e,
441                                         "olmBDBIDLCache")) != NULL)
442                                 {
443                                         olmbdb_data = *olmbdb_list[0];
444                                         ssnprintf (typeinst, sizeof (typeinst),
445                                                 "bdbidlcache-%s", nc_data.bv_val);
446                                         cldap_submit_gauge ("cache_size", typeinst,
447                                                 atoll (olmbdb_data.bv_val), st);
448                                         ldap_value_free_len (olmbdb_list);
449                                 }
450
451                                 ldap_value_free_len (nc_list);
452                         }
453                         else if (strcmp (dn,
454                                         "cn=Bytes,cn=Statistics,cn=Monitor")
455                                         == 0)
456                         {
457                                 cldap_submit_derive ("derive", "statistics-bytes",
458                                         counter, st);
459                         }
460                         else if (strcmp (dn,
461                                         "cn=PDU,cn=Statistics,cn=Monitor")
462                                         == 0)
463                         {
464                                 cldap_submit_derive ("derive", "statistics-pdu",
465                                         counter, st);
466                         }
467                         else if (strcmp (dn,
468                                         "cn=Entries,cn=Statistics,cn=Monitor")
469                                         == 0)
470                         {
471                                 cldap_submit_derive ("derive", "statistics-entries",
472                                         counter, st);
473                         }
474                         else if (strcmp (dn,
475                                         "cn=Referrals,cn=Statistics,cn=Monitor")
476                                         == 0)
477                         {
478                                 cldap_submit_derive ("derive", "statistics-referrals",
479                                         counter, st);
480                         }
481                         else if (strcmp (dn,
482                                         "cn=Open,cn=Threads,cn=Monitor")
483                                         == 0)
484                         {
485                                 cldap_submit_gauge ("threads", "threads-open",
486                                         info, st);
487                         }
488                         else if (strcmp (dn,
489                                         "cn=Starting,cn=Threads,cn=Monitor")
490                                         == 0)
491                         {
492                                 cldap_submit_gauge ("threads", "threads-starting",
493                                         info, st);
494                         }
495                         else if (strcmp (dn,
496                                         "cn=Active,cn=Threads,cn=Monitor")
497                                         == 0)
498                         {
499                                 cldap_submit_gauge ("threads", "threads-active",
500                                         info, st);
501                         }
502                         else if (strcmp (dn,
503                                         "cn=Pending,cn=Threads,cn=Monitor")
504                                         == 0)
505                         {
506                                 cldap_submit_gauge ("threads", "threads-pending",
507                                         info, st);
508                         }
509                         else if (strcmp (dn,
510                                         "cn=Backload,cn=Threads,cn=Monitor")
511                                         == 0)
512                         {
513                                 cldap_submit_gauge ("threads", "threads-backload",
514                                         info, st);
515                         }
516                         else if (strcmp (dn,
517                                         "cn=Read,cn=Waiters,cn=Monitor")
518                                         == 0)
519                         {
520                                 cldap_submit_derive ("derive", "waiters-read",
521                                         counter, st);
522                         }
523                         else if (strcmp (dn,
524                                         "cn=Write,cn=Waiters,cn=Monitor")
525                                         == 0)
526                         {
527                                 cldap_submit_derive ("derive", "waiters-write",
528                                         counter, st);
529                         }
530
531                         ldap_value_free_len (counter_list);
532                         ldap_value_free_len (opc_list);
533                         ldap_value_free_len (opi_list);
534                         ldap_value_free_len (info_list);
535                 }
536
537                 ldap_memfree (dn);
538         }
539
540         ldap_msgfree (result);
541         return (0);
542 } /* }}} int cldap_read_host */
543
544 /* Configuration handling functions {{{
545  *
546  * <Plugin ldap>
547  *   <Instance "plugin_instance1">
548  *     URL "ldap://localhost"
549  *     ...
550  *   </Instance>
551  * </Plugin>
552  */
553
554 static int cldap_config_add (oconfig_item_t *ci) /* {{{ */
555 {
556         cldap_t *st;
557         int i;
558         int status;
559
560         st = malloc (sizeof (*st));
561         if (st == NULL)
562         {
563                 ERROR ("openldap plugin: malloc failed.");
564                 return (-1);
565         }
566         memset (st, 0, sizeof (*st));
567
568         status = cf_util_get_string (ci, &st->name);
569         if (status != 0)
570         {
571                 sfree (st);
572                 return (status);
573         }
574
575         st->starttls = 0;
576         st->timeout = (long) (CDTIME_T_TO_MS(plugin_get_interval()) / 1000);
577         st->verifyhost = 1;
578         st->version = LDAP_VERSION3;
579
580         for (i = 0; i < ci->children_num; i++)
581         {
582                 oconfig_item_t *child = ci->children + i;
583
584                 if (strcasecmp ("BindDN", child->key) == 0)
585                         status = cf_util_get_string (child, &st->binddn);
586                 else if (strcasecmp ("Password", child->key) == 0)
587                         status = cf_util_get_string (child, &st->password);
588                 else if (strcasecmp ("CACert", child->key) == 0)
589                         status = cf_util_get_string (child, &st->cacert);
590                 else if (strcasecmp ("StartTLS", child->key) == 0)
591                         status = cf_util_get_boolean (child, &st->starttls);
592                 else if (strcasecmp ("Timeout", child->key) == 0)
593                         status = cf_util_get_int (child, &st->timeout);
594                 else if (strcasecmp ("URL", child->key) == 0)
595                         status = cf_util_get_string (child, &st->url);
596                 else if (strcasecmp ("VerifyHost", child->key) == 0)
597                         status = cf_util_get_boolean (child, &st->verifyhost);
598                 else if (strcasecmp ("Version", child->key) == 0)
599                         status = cf_util_get_int (child, &st->version);
600                 else
601                 {
602                         WARNING ("openldap plugin: Option `%s' not allowed here.",
603                                         child->key);
604                         status = -1;
605                 }
606
607                 if (status != 0)
608                         break;
609         }
610
611         /* Check if struct is complete.. */
612         if ((status == 0) && (st->url == NULL))
613         {
614                 ERROR ("openldap plugin: Instance `%s': "
615                                 "No URL has been configured.",
616                                 st->name);
617                 status = -1;
618         }
619
620         /* Check if URL is valid */
621         if ((status == 0) && (st->url != NULL))
622         {
623                 LDAPURLDesc *ludpp;
624                 int rc;
625
626                 if ((rc = ldap_url_parse (st->url, &ludpp)) != 0)
627                 {
628                         ERROR ("openldap plugin: Instance `%s': "
629                                 "Invalid URL: `%s'",
630                                 st->name, st->url);
631                         status = -1;
632                 }
633
634                 if ((status == 0) && (ludpp->lud_host != NULL))
635                 {
636                         st->host = strdup (ludpp->lud_host);
637                 }
638
639                 ldap_free_urldesc (ludpp);
640         }
641
642         if (status == 0)
643         {
644                 user_data_t ud;
645                 char callback_name[3*DATA_MAX_NAME_LEN];
646
647                 memset (&ud, 0, sizeof (ud));
648                 ud.data = st;
649
650                 memset (callback_name, 0, sizeof (callback_name));
651                 ssnprintf (callback_name, sizeof (callback_name),
652                                 "openldap/%s/%s",
653                                 (st->host != NULL) ? st->host : hostname_g,
654                                 (st->name != NULL) ? st->name : "default"),
655
656                 status = plugin_register_complex_read (/* group = */ NULL,
657                                 /* name      = */ callback_name,
658                                 /* callback  = */ cldap_read_host,
659                                 /* interval  = */ 0,
660                                 /* user_data = */ &ud);
661         }
662
663         if (status != 0)
664         {
665                 cldap_free (st);
666                 return (-1);
667         }
668
669         return (0);
670 } /* }}} int cldap_config_add */
671
672 static int cldap_config (oconfig_item_t *ci) /* {{{ */
673 {
674         int i;
675         int status = 0;
676
677         for (i = 0; i < ci->children_num; i++)
678         {
679                 oconfig_item_t *child = ci->children + i;
680
681                 if (strcasecmp ("Instance", child->key) == 0)
682                         cldap_config_add (child);
683                 else
684                         WARNING ("openldap plugin: The configuration option "
685                                         "\"%s\" is not allowed here. Did you "
686                                         "forget to add an <Instance /> block "
687                                         "around the configuration?",
688                                         child->key);
689         } /* for (ci->children) */
690
691         return (status);
692 } /* }}} int cldap_config */
693
694 /* }}} End of configuration handling functions */
695
696 static int cldap_init (void) /* {{{ */
697 {
698         /* Initialize LDAP library while still single-threaded as recommended in
699          * ldap_initialize(3) */
700         int debug_level;
701         ldap_get_option (NULL, LDAP_OPT_DEBUG_LEVEL, &debug_level);
702         return (0);
703 } /* }}} int cldap_init */
704
705 void module_register (void) /* {{{ */
706 {
707         plugin_register_complex_config ("openldap", cldap_config);
708         plugin_register_init ("openldap", cldap_init);
709 } /* }}} void module_register */