comparison src/eldap.c @ 265:8efd647ea9ca r20-5b31

Import from CVS: tag r20-5b31
author cvs
date Mon, 13 Aug 2007 10:25:37 +0200
parents 405dd6d1825b
children c5d627a313b1
comparison
equal deleted inserted replaced
264:682d2a9d41a5 265:8efd647ea9ca
1 /* LDAP client interface for XEmacs. 1 /* LDAP client interface for XEmacs.
2 Copyright (C) ***FIXME*** 2 Copyright (C) 1998 Free Software Foundation, Inc.
3 3
4 This file is part of XEmacs. 4 This file is part of XEmacs.
5 5
6 XEmacs is free software; you can redistribute it and/or modify it 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 7 under the terms of the GNU General Public License as published by the
35 #if defined (HAVE_LDAP) 35 #if defined (HAVE_LDAP)
36 36
37 /* The entire file is within this conditional */ 37 /* The entire file is within this conditional */
38 38
39 #include "lisp.h" 39 #include "lisp.h"
40
41 #include <errno.h>
40 42
41 #include "eldap.h" 43 #include "eldap.h"
42 #include <lber.h> 44 #include <lber.h>
43 #include <ldap.h> 45 #include <ldap.h>
44 46
291 This is ugly, I know, but without this, the UMich LDAP library 3.3 293 This is ugly, I know, but without this, the UMich LDAP library 3.3
292 frequently reports "Can't contact LDAP server". I really need to 294 frequently reports "Can't contact LDAP server". I really need to
293 check what happens inside that lib. Anyway this should be harmless to 295 check what happens inside that lib. Anyway this should be harmless to
294 XEmacs and makes things work. */ 296 XEmacs and makes things work. */
295 #if defined (HAVE_UMICH_LDAP) 297 #if defined (HAVE_UMICH_LDAP)
296 Fgarbage_collect (); 298 garbage_collect_1 ();
297 #endif 299 #endif
298 300
299 /* Connect to the server and bind */ 301 /* Connect to the server and bind */
300 message ("Connecting to %s...", ldap_host); 302 message ("Connecting to %s...", ldap_host);
301 if ( (ld = ldap_open (ldap_host, LDAP_PORT)) == NULL ) 303 if ( (ld = ldap_open (ldap_host, LDAP_PORT)) == NULL )
302 signal_simple_error ("Failed connecting to host", 304 signal_simple_error_2 ("Failed connecting to host",
303 build_string (ldap_host)); 305 build_string (ldap_host),
306 lisp_strerror (errno));
304 307
305 #if HAVE_LDAP_SET_OPTION 308 #if HAVE_LDAP_SET_OPTION
306 if (ldap_set_option (ld, LDAP_OPT_DEREF, (void *)&ldap_deref) != LDAP_SUCCESS) 309 if (ldap_set_option (ld, LDAP_OPT_DEREF, (void *)&ldap_deref) != LDAP_SUCCESS)
307 error ("Failed to set deref option"); 310 error ("Failed to set deref option");
308 if (ldap_set_option (ld, LDAP_OPT_TIMELIMIT, (void *)&ldap_timelimit) != LDAP_SUCCESS) 311 if (ldap_set_option (ld, LDAP_OPT_TIMELIMIT, (void *)&ldap_timelimit) != LDAP_SUCCESS)