X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fsaucer%2Fmain.c;h=a49a3bf896a84cdb3b7f6132807550603e26f586;hb=4e703c5261cd179ab675cdeaca4b0eda88db0977;hp=8d866dcd44faee7e9e71c8651ccd063decf41523;hpb=a3bc2bbe6382b9613a23cab87c1c4b96147b7512;p=openldap diff --git a/contrib/saucer/main.c b/contrib/saucer/main.c index 8d866dcd44..a49a3bf896 100644 --- a/contrib/saucer/main.c +++ b/contrib/saucer/main.c @@ -20,7 +20,8 @@ #include "portable.h" #include -#include + +#include #ifdef HAVE_READLINE # include @@ -613,7 +614,7 @@ int main(int argc, char **argv) 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; @@ -633,15 +634,15 @@ int main(int argc, char **argv) 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())