259
|
1 /* LDAP client interface for XEmacs.
|
265
|
2 Copyright (C) 1998 Free Software Foundation, Inc.
|
259
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
6 XEmacs is free software; you can redistribute it and/or modify it
|
|
7 under the terms of the GNU General Public License as published by the
|
|
8 Free Software Foundation; either version 2, or (at your option) any
|
|
9 later version.
|
|
10
|
|
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with XEmacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
|
20
|
|
21 /* Synched up with: Not in FSF. */
|
|
22
|
|
23 /* Author: Oscar Figueiredo */
|
|
24
|
|
25 /* This file provides lisp primitives for access to an LDAP library
|
|
26 conforming to the API defined in RFC 1823.
|
|
27 It has been tested with:
|
|
28 - UMich LDAP 3.3 (http://www.umich.edu/~dirsvcs/ldap/)
|
|
29 - Netscape's LDAP SDK 1.0 (http://developer.netscape.com) */
|
|
30
|
|
31
|
|
32 #include <config.h>
|
|
33 #include "lisp.h"
|
|
34
|
265
|
35 #include <errno.h>
|
259
|
36 #include <lber.h>
|
|
37 #include <ldap.h>
|
|
38
|
276
|
39 #include "eldap.h"
|
|
40
|
259
|
41 #ifdef HAVE_NS_LDAP
|
|
42 #define HAVE_LDAP_SET_OPTION 1
|
|
43 #define HAVE_LDAP_GET_ERRNO 1
|
|
44 #else
|
|
45 #undef HAVE_LDAP_SET_OPTION
|
|
46 #undef HAVE_LDAP_GET_ERRNO
|
|
47 #endif
|
|
48
|
276
|
49
|
259
|
50
|
276
|
51 static int ldap_default_port;
|
|
52 static Lisp_Object Vldap_default_base;
|
|
53
|
|
54 /* ldap-open plist keywords */
|
|
55 static Lisp_Object Qport, Qauth, Qbinddn, Qpasswd, Qderef, Qtimelimit,
|
|
56 Qsizelimit;
|
259
|
57 /* Search scope limits */
|
|
58 static Lisp_Object Qbase, Qonelevel, Qsubtree;
|
|
59 /* Authentication methods */
|
|
60 #ifdef LDAP_AUTH_KRBV41
|
|
61 static Lisp_Object Qkrbv41;
|
|
62 #endif
|
|
63 #ifdef LDAP_AUTH_KRBV42
|
|
64 static Lisp_Object Qkrbv42;
|
|
65 #endif
|
|
66 /* Deref policy */
|
261
|
67 static Lisp_Object Qnever, Qalways, Qfind;
|
259
|
68
|
276
|
69 static Lisp_Object Qldapp;
|
|
70
|
|
71
|
|
72 /************************************************************************/
|
|
73 /* Utility Functions */
|
|
74 /************************************************************************/
|
|
75
|
|
76 static void
|
|
77 signal_ldap_error (LDAP *ld)
|
|
78 {
|
|
79 #if HAVE_LDAP_GET_ERRNO
|
|
80 signal_simple_error
|
|
81 ("LDAP error",
|
|
82 build_string (ldap_err2string (ldap_get_lderrno (ld, NULL, NULL))));
|
|
83 #else
|
|
84 signal_simple_error ("LDAP error",
|
|
85 build_string (ldap_err2string (ld->ld_errno)));
|
|
86 #endif
|
|
87 }
|
|
88
|
|
89
|
|
90 /************************************************************************/
|
|
91 /* The ldap Lisp object */
|
|
92 /************************************************************************/
|
|
93
|
|
94 /*
|
|
95 * Structure records pertinent information about an open LDAP connection.
|
|
96 */
|
|
97
|
|
98 struct Lisp_LDAP
|
|
99 {
|
|
100 /* lcrecord header */
|
|
101 struct lcrecord_header header;
|
|
102 /* The LDAP connection handle used by the LDAP API */
|
|
103 LDAP *ld;
|
|
104 /* Name of the host we connected to */
|
|
105 Lisp_Object host;
|
|
106 /* Status of the LDAP connection.
|
|
107 This is a symbol: open or closed */
|
|
108 Lisp_Object status_symbol;
|
|
109 };
|
|
110
|
|
111
|
|
112
|
|
113 static Lisp_Object
|
|
114 mark_ldap (Lisp_Object obj, void (*markobj) (Lisp_Object))
|
|
115 {
|
|
116 struct Lisp_LDAP *ldap = XLDAP (obj);
|
|
117 ((markobj) (ldap->host));
|
|
118 return ldap->status_symbol;
|
|
119 }
|
|
120
|
|
121 static void
|
|
122 print_ldap (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
|
|
123 {
|
|
124 char buf[16];
|
|
125
|
|
126 struct Lisp_LDAP *ldap = XLDAP (obj);
|
|
127
|
|
128 if (print_readably)
|
|
129 error ("printing unreadable object #<ldap %s>",
|
|
130 XSTRING_DATA (ldap->host));
|
|
131
|
|
132 if (!escapeflag)
|
|
133 {
|
|
134 print_internal (ldap->host, printcharfun, 0);
|
|
135 }
|
|
136 else
|
|
137 {
|
|
138 write_c_string (GETTEXT ("#<ldap "), printcharfun);
|
|
139 print_internal (ldap->host, printcharfun, 1);
|
|
140 write_c_string (" state:",printcharfun);
|
|
141 print_internal (ldap->status_symbol, printcharfun, 1);
|
|
142 sprintf (buf, " 0x%x>", ldap);
|
|
143 write_c_string (buf, printcharfun);
|
|
144 }
|
|
145 }
|
|
146
|
|
147 static struct Lisp_LDAP *
|
|
148 allocate_ldap (void)
|
|
149 {
|
|
150 struct Lisp_LDAP *ldap =
|
|
151 alloc_lcrecord_type (struct Lisp_LDAP, lrecord_ldap);
|
|
152
|
|
153 ldap->ld = (LDAP *) NULL;
|
|
154 ldap->host = Qnil;
|
|
155 ldap->status_symbol = Qnil;
|
|
156 return ldap;
|
|
157 }
|
|
158
|
|
159 DEFINE_LRECORD_IMPLEMENTATION ("ldap", ldap,
|
|
160 mark_ldap, print_ldap, NULL,
|
|
161 NULL, NULL, struct Lisp_LDAP);
|
|
162
|
|
163
|
|
164
|
|
165
|
|
166 /************************************************************************/
|
|
167 /* Basic ldap accessors */
|
|
168 /************************************************************************/
|
|
169
|
|
170 DEFUN ("ldapp", Fldapp, 1, 1, 0, /*
|
|
171 Return t if OBJECT is a LDAP connection.
|
|
172 */
|
|
173 (object))
|
|
174 {
|
|
175 return LDAPP (object) ? Qt : Qnil;
|
|
176 }
|
|
177
|
|
178
|
|
179 DEFUN ("ldap-host", Fldap_host, 1, 1, 0, /*
|
|
180 Return the server host of the connection LDAP, as a string.
|
|
181 */
|
|
182 (ldap))
|
|
183 {
|
|
184 CHECK_LDAP (ldap);
|
|
185 return (XLDAP (ldap))->host;
|
|
186 }
|
|
187
|
|
188
|
|
189
|
|
190 DEFUN ("ldap-status", Fldap_status, 1, 1, 0, /*
|
|
191 Return the status of the connection LDAP.
|
|
192 This is a symbol, one of these:
|
|
193
|
|
194 open -- for a LDAP connection that is open.
|
|
195 closed -- for a LDAP connection that is closed.
|
|
196 */
|
|
197 (ldap))
|
|
198 {
|
|
199 CHECK_LDAP (ldap);
|
|
200 return (XLDAP (ldap))->status_symbol;
|
|
201 }
|
|
202
|
|
203
|
|
204
|
|
205 /************************************************************************/
|
|
206 /* Opening/Closing a LDAP connection */
|
|
207 /************************************************************************/
|
|
208
|
|
209
|
|
210 DEFUN ("ldap-open", Fldap_open, 1, 2, 0, /*
|
|
211 Open a LDAP connection to HOST.
|
|
212 PLIST is a plist containing additional parameters for the connection.
|
259
|
213 Valid keys in that list are:
|
276
|
214 `port' the TCP port to use for the connection if different from
|
|
215 `ldap-default-port'.
|
259
|
216 `auth' is the authentication method to use, possible values depend on
|
|
217 the LDAP library XEmacs was compiled with: `simple', `krbv41' and `krbv42'.
|
|
218 `binddn' is the distinguished name of the user to bind as (in RFC 1779 syntax).
|
|
219 `passwd' is the password to use for simple authentication.
|
|
220 `deref' is one of the symbols `never', `always', `search' or `find'.
|
|
221 `timelimit' is the timeout limit for the connection in seconds.
|
|
222 `sizelimit' is the maximum number of matches to return.
|
|
223 */
|
276
|
224 (host, plist))
|
259
|
225 {
|
276
|
226 /* This function can call lisp */
|
259
|
227
|
276
|
228 struct Lisp_LDAP *lisp_ldap;
|
259
|
229 LDAP *ld;
|
276
|
230 int ldap_port = 0;
|
259
|
231 int ldap_auth = LDAP_AUTH_SIMPLE;
|
|
232 char *ldap_binddn = NULL;
|
|
233 char *ldap_passwd = NULL;
|
|
234 int ldap_deref = LDAP_DEREF_NEVER;
|
|
235 int ldap_timelimit = 0;
|
|
236 int ldap_sizelimit = 0;
|
276
|
237 int err;
|
259
|
238
|
276
|
239 Lisp_Object ldap, list, keyword, value;
|
|
240 struct gcpro gcpro1;
|
259
|
241
|
276
|
242 ldap = Qnil;
|
|
243 GCPRO1 (ldap);
|
259
|
244
|
276
|
245 CHECK_STRING (host);
|
|
246
|
|
247 EXTERNAL_PROPERTY_LIST_LOOP(list, keyword, value, plist)
|
|
248 {
|
|
249 /* TCP Port */
|
|
250 if (EQ (keyword, Qport))
|
259
|
251 {
|
276
|
252 CHECK_INT (value);
|
|
253 ldap_port = XINT (value);
|
259
|
254 }
|
|
255 /* Authentication method */
|
276
|
256 if (EQ (keyword, Qauth))
|
259
|
257 {
|
|
258 CHECK_SYMBOL (value);
|
|
259
|
|
260 if (EQ (value, Qsimple))
|
|
261 ldap_auth = LDAP_AUTH_SIMPLE;
|
|
262 #ifdef LDAP_AUTH_KRBV41
|
|
263 else if (EQ (value, Qkrbv41))
|
|
264 ldap_auth = LDAP_AUTH_KRBV41;
|
|
265 #endif
|
|
266 #ifdef LDAP_AUTH_KRBV42
|
|
267 else if (EQ (value, Qkrbv42))
|
|
268 ldap_auth = LDAP_AUTH_KRBV42;
|
|
269 #endif
|
|
270 else
|
|
271 signal_simple_error ("Invalid authentication method", value);
|
|
272 }
|
|
273 /* Bind DN */
|
|
274 else if (EQ (keyword, Qbinddn))
|
|
275 {
|
276
|
276 CHECK_STRING (value);
|
|
277 ldap_binddn = alloca (XSTRING_LENGTH (value) + 1);
|
|
278 strcpy (ldap_binddn, (char *)XSTRING_DATA (value));
|
259
|
279 }
|
|
280 /* Password */
|
|
281 else if (EQ (keyword, Qpasswd))
|
|
282 {
|
276
|
283 CHECK_STRING (value);
|
|
284 ldap_passwd = alloca (XSTRING_LENGTH (value) + 1);
|
|
285 strcpy (ldap_passwd, (char *)XSTRING_DATA (value));
|
259
|
286 }
|
|
287 /* Deref */
|
|
288 else if (EQ (keyword, Qderef))
|
|
289 {
|
|
290 CHECK_SYMBOL (value);
|
|
291 if (EQ (value, Qnever))
|
|
292 ldap_deref = LDAP_DEREF_NEVER;
|
|
293 else if (EQ (value, Qsearch))
|
|
294 ldap_deref = LDAP_DEREF_SEARCHING;
|
|
295 else if (EQ (value, Qfind))
|
|
296 ldap_deref = LDAP_DEREF_FINDING;
|
|
297 else if (EQ (value, Qalways))
|
|
298 ldap_deref = LDAP_DEREF_ALWAYS;
|
|
299 else
|
|
300 signal_simple_error ("Invalid deref value", value);
|
|
301 }
|
|
302 /* Timelimit */
|
|
303 else if (EQ (keyword, Qtimelimit))
|
|
304 {
|
276
|
305 CHECK_INT (value);
|
|
306 ldap_timelimit = XINT (value);
|
259
|
307 }
|
|
308 /* Sizelimit */
|
|
309 else if (EQ (keyword, Qsizelimit))
|
|
310 {
|
276
|
311 CHECK_INT (value);
|
|
312 ldap_sizelimit = XINT (value);
|
259
|
313 }
|
|
314 }
|
|
315
|
276
|
316 if (ldap_port == 0)
|
259
|
317 {
|
276
|
318 ldap_port = ldap_default_port;
|
259
|
319 }
|
|
320
|
276
|
321 /* Connect to the server and bind */
|
|
322 ld = ldap_open ((char *)XSTRING_DATA (host), ldap_port);
|
|
323 if (ld == NULL )
|
|
324 signal_simple_error_2 ("Failed connecting to host",
|
|
325 host,
|
|
326 lisp_strerror (errno));
|
259
|
327
|
|
328
|
|
329 #if HAVE_LDAP_SET_OPTION
|
|
330 if (ldap_set_option (ld, LDAP_OPT_DEREF, (void *)&ldap_deref) != LDAP_SUCCESS)
|
276
|
331 signal_ldap_error (ld);
|
|
332 if (ldap_set_option (ld, LDAP_OPT_TIMELIMIT,
|
|
333 (void *)&ldap_timelimit) != LDAP_SUCCESS)
|
|
334 signal_ldap_error (ld);
|
|
335 if (ldap_set_option (ld, LDAP_OPT_SIZELIMIT,
|
|
336 (void *)&ldap_sizelimit) != LDAP_SUCCESS)
|
|
337 signal_ldap_error (ld);
|
259
|
338 if (ldap_set_option (ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON) != LDAP_SUCCESS)
|
276
|
339 signal_ldap_error (ld);
|
259
|
340 #else /* HAVE_LDAP_SET_OPTION */
|
|
341 ld->ld_deref = ldap_deref;
|
|
342 ld->ld_timelimit = ldap_timelimit;
|
|
343 ld->ld_sizelimit = ldap_sizelimit;
|
|
344 #ifdef LDAP_REFERRALS
|
|
345 ld->ld_options = LDAP_OPT_REFERRALS;
|
|
346 #else /* LDAP_REFERRALS */
|
|
347 ld->ld_options = 0;
|
|
348 #endif /* LDAP_REFERRALS */
|
|
349 #endif /* HAVE_LDAP_SET_OPTION */
|
|
350
|
276
|
351 /* ldap_bind_s calls select and may be wedged by spurious signals */
|
|
352 slow_down_interrupts ();
|
|
353 err = ldap_bind_s (ld, ldap_binddn, ldap_passwd, ldap_auth);
|
|
354 speed_up_interrupts ();
|
|
355 if (err != LDAP_SUCCESS)
|
259
|
356 signal_simple_error ("Failed binding to the server",
|
|
357 build_string (ldap_err2string (err)));
|
|
358
|
276
|
359 lisp_ldap = allocate_ldap ();
|
|
360 lisp_ldap->ld = ld;
|
|
361 lisp_ldap->host = host;
|
|
362 lisp_ldap->status_symbol = Qopen;
|
|
363 XSETLDAP (ldap,lisp_ldap);
|
|
364
|
|
365 UNGCPRO;
|
|
366 return ldap;
|
|
367 }
|
|
368
|
|
369
|
|
370
|
|
371 DEFUN ("ldap-close", Fldap_close, 1, 1, 0, /*
|
|
372 Close an LDAP connection.
|
|
373 Return t if the connection was actually closed or nil if
|
|
374 it was already closed before the call
|
|
375 */
|
|
376 (ldap))
|
|
377 {
|
|
378 CHECK_LDAP (ldap);
|
|
379 if ( EQ ((XLDAP (ldap))->status_symbol, Qopen) )
|
259
|
380 {
|
276
|
381 ldap_unbind ((XLDAP (ldap))->ld);
|
|
382 (XLDAP (ldap))->status_symbol = Qclosed;
|
|
383 return Qt;
|
|
384 }
|
|
385 return Qnil;
|
|
386 }
|
|
387
|
|
388
|
|
389
|
|
390 /************************************************************************/
|
|
391 /* Working on a LDAP connection */
|
|
392 /************************************************************************/
|
|
393
|
|
394 DEFUN ("ldap-search-internal", Fldap_search_internal, 2, 6, 0, /*
|
|
395 Perform a search on an open LDAP connection.
|
|
396 LDAP is an LDAP connection object created with `ldap-open'.
|
|
397 FILTER is a filter string for the search as described in RFC 1558
|
|
398 BASE is the distinguished name at which to start the search
|
|
399 SCOPE is an integer or a symbol indicating the scope of the search
|
|
400 Possible values are `ldap-scope-base', `ldap-scope-onelevel' or
|
|
401 `ldap-scope-subtree'
|
|
402 ATTRS is a list of strings indicating which attributes to retrieve
|
|
403 for each matching entry. If nil return all available attributes.
|
|
404 If ATTRSONLY is non-nil then only the attributes are retrieved, not
|
|
405 the associated values
|
|
406 The function returns a list of matching entries. Each entry is itself
|
|
407 an alist of attribute/values.
|
|
408 */
|
|
409 (ldap, filter, base, scope, attrs, attrsonly))
|
|
410 {
|
|
411 /* This function can call lisp */
|
|
412
|
|
413 /* Vars for query */
|
|
414 LDAP *ld;
|
|
415 LDAPMessage *res, *e;
|
|
416 BerElement *ptr;
|
|
417 char *a;
|
|
418 int i, rc, err;
|
|
419
|
|
420 char **vals = NULL;
|
|
421 int matches;
|
|
422
|
|
423 int ldap_scope = LDAP_SCOPE_SUBTREE;
|
|
424 char **ldap_attributes = NULL;
|
|
425
|
|
426 Lisp_Object list, entry, result;
|
|
427 struct gcpro gcpro1, gcpro2, gcpro3;
|
|
428
|
|
429 list = entry = result = Qnil;
|
|
430 GCPRO3(list, entry, result);
|
|
431
|
|
432 /* Do all the parameter checking */
|
|
433 CHECK_LIVE_LDAP (ldap);
|
|
434 ld = (XLDAP (ldap))->ld;
|
|
435
|
|
436 /* Filter */
|
|
437 CHECK_STRING (filter);
|
|
438
|
|
439 /* Search base */
|
|
440 if (NILP (base))
|
|
441 {
|
|
442 base = Vldap_default_base;
|
|
443 }
|
|
444 if (!NILP (base))
|
|
445 {
|
|
446 CHECK_STRING (Vldap_default_base);
|
|
447 }
|
|
448
|
|
449 /* Search scope */
|
|
450 if (!NILP (scope))
|
|
451 {
|
|
452 CHECK_SYMBOL (scope);
|
|
453 if (EQ (scope, Qbase))
|
|
454 ldap_scope = LDAP_SCOPE_BASE;
|
|
455 else if (EQ (scope, Qonelevel))
|
|
456 ldap_scope = LDAP_SCOPE_ONELEVEL;
|
|
457 else if (EQ (scope, Qsubtree))
|
|
458 ldap_scope = LDAP_SCOPE_SUBTREE;
|
|
459 else
|
|
460 signal_simple_error ("Invalid scope", scope);
|
|
461 }
|
|
462
|
|
463 /* Attributes to search */
|
|
464 if (!NILP (attrs))
|
|
465 {
|
|
466 Lisp_Object attr_left = attrs;
|
|
467 struct gcpro ngcpro1;
|
|
468
|
|
469 NGCPRO1 (attr_left);
|
|
470 CHECK_CONS (attrs);
|
|
471
|
|
472 ldap_attributes = alloca ((XINT (Flength (attrs)) + 1)*sizeof (char *));
|
|
473
|
|
474 for (i=0; !NILP (attr_left); i++) {
|
|
475 CHECK_STRING (XCAR (attr_left));
|
|
476 ldap_attributes[i] = alloca (XSTRING_LENGTH (XCAR (attr_left)) + 1);
|
|
477 strcpy(ldap_attributes[i],
|
|
478 (char *)(XSTRING_DATA( XCAR (attr_left))));
|
|
479 attr_left = XCDR (attr_left);
|
|
480 }
|
|
481 ldap_attributes[i] = NULL;
|
|
482 NUNGCPRO;
|
|
483 }
|
|
484
|
|
485 /* Attributes only ? */
|
|
486 CHECK_SYMBOL (attrsonly);
|
|
487
|
|
488
|
|
489 /* Perform the search */
|
|
490 if (ldap_search (ld,
|
|
491 NILP (base) ? "" : (char *) XSTRING_DATA (base),
|
|
492 ldap_scope,
|
|
493 NILP (filter) ? "" : (char *) XSTRING_DATA (filter),
|
|
494 ldap_attributes,
|
|
495 NILP (attrsonly) ? 0 : 1)
|
|
496 == -1)
|
|
497 {
|
|
498 signal_ldap_error (ld);
|
259
|
499 }
|
|
500
|
|
501 /* Build the results list */
|
|
502 matches = 0;
|
|
503
|
276
|
504 /* ldap_result calls select() and can get wedged by EINTR signals */
|
|
505 slow_down_interrupts ();
|
|
506 rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &res);
|
|
507 speed_up_interrupts ();
|
|
508 while ( rc == LDAP_RES_SEARCH_ENTRY )
|
259
|
509 {
|
|
510 matches ++;
|
|
511 e = ldap_first_entry (ld, res);
|
|
512 message ("Parsing results... %d", matches);
|
|
513 entry = Qnil;
|
|
514 for (a= ldap_first_attribute (ld, e, &ptr);
|
|
515 a != NULL;
|
|
516 a= ldap_next_attribute (ld, e, ptr) )
|
|
517 {
|
|
518 list = Fcons (build_string (a), Qnil);
|
|
519 vals = ldap_get_values (ld, e, a);
|
|
520 if (vals != NULL)
|
|
521 {
|
|
522 for (i=0; vals[i]!=NULL; i++)
|
|
523 {
|
|
524 list = Fcons (build_string (vals[i]),
|
|
525 list);
|
|
526 }
|
|
527 }
|
|
528 entry = Fcons (Fnreverse (list),
|
|
529 entry);
|
|
530 ldap_value_free (vals);
|
|
531 }
|
|
532 result = Fcons (Fnreverse (entry),
|
|
533 result);
|
|
534 ldap_msgfree (res);
|
276
|
535
|
|
536 slow_down_interrupts ();
|
|
537 rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &res);
|
|
538 speed_up_interrupts ();
|
259
|
539 }
|
|
540
|
|
541 if (rc == -1)
|
|
542 {
|
276
|
543 signal_ldap_error (ld);
|
259
|
544 }
|
|
545
|
|
546 if ((rc = ldap_result2error (ld, res, 0)) != LDAP_SUCCESS)
|
|
547 {
|
276
|
548 signal_ldap_error (ld);
|
259
|
549 }
|
|
550
|
|
551 ldap_msgfree (res);
|
|
552 message ("Done.");
|
|
553
|
|
554 result = Fnreverse (result);
|
|
555 clear_message ();
|
|
556
|
|
557 UNGCPRO;
|
|
558 return result;
|
|
559 }
|
|
560
|
|
561
|
|
562 void
|
|
563 syms_of_eldap (void)
|
|
564 {
|
276
|
565 defsymbol (&Qldapp, "ldapp");
|
259
|
566
|
276
|
567 DEFSUBR (Fldapp);
|
|
568 DEFSUBR (Fldap_host);
|
|
569 DEFSUBR (Fldap_status);
|
|
570 DEFSUBR (Fldap_open);
|
|
571 DEFSUBR (Fldap_close);
|
|
572 DEFSUBR (Fldap_search_internal);
|
259
|
573 }
|
|
574
|
|
575 void
|
|
576 vars_of_eldap (void)
|
|
577 {
|
276
|
578 Fprovide (intern ("ldap"));
|
259
|
579
|
276
|
580 ldap_default_port = LDAP_PORT;
|
|
581 Vldap_default_base = Qnil;
|
|
582
|
|
583 DEFVAR_INT ("ldap-default-port", &ldap_default_port /*
|
|
584 Default TCP port for LDAP connections.
|
|
585 Initialized from the LDAP library. Default value is 389.
|
259
|
586 */ );
|
|
587
|
|
588 DEFVAR_LISP ("ldap-default-base", &Vldap_default_base /*
|
|
589 Default base for LDAP searches.
|
|
590 This is a string using the syntax of RFC 1779.
|
|
591 For instance, "o=ACME, c=US" limits the search to the
|
|
592 Acme organization in the United States.
|
|
593 */ );
|
|
594
|
|
595 }
|
276
|
596
|
|
597
|