#include "portable.h"
#include <stdio.h>
-#include <stdlib.h>
+
+#include <ac/stdlib.h>
#ifdef HAVE_READLINE
# include <readline/readline.h>
case 'd':
#ifdef LDAP_DEBUG
tmp = atoi(optarg);
- lber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &tmp);
+ ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &tmp);
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &tmp);
#endif
break;
if (error_flag) {
fprintf(stderr, "usage: %s [-h host] [-p portnumber] [-u X500UserName]\n\t[-c credentials] [-d debug-level]\n",
progname);
- exit(2);
+ exit( EXIT_FAILURE );
}
rc = user_tailor();
- if (!(ld = ldap_open(hostname, portnum))) {
- fprintf(stderr, "%s: unable to connect to server at host `%s' on port %d\n",
+ if (!(ld = ldap_init(hostname, portnum))) {
+ fprintf(stderr, "%s: unable to initialize LDAP session (%s:%d)\n",
progname, hostname, portnum);
- exit(2);
+ exit( EXIT_FAILURE );
}
if (!bind_user())