From fd4b8ba0cd8c1aedb91837d36cfaafac3a64a735 Mon Sep 17 00:00:00 2001 From: Gary Williams Date: Thu, 12 Oct 2000 20:13:20 +0000 Subject: [PATCH] example client using new logging --- clients/tools/ldapsearch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 13a786b248..c4432f67e9 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -165,6 +165,7 @@ main( int argc, char **argv ) { char *infile, *filtpattern, **attrs = NULL, line[BUFSIZ]; FILE *fp = NULL; + FILE *log = NULL; int rc, i, first, scope, deref, attrsonly, manageDSAit; int referrals, timelimit, sizelimit, debug; int authmethod, version, want_bindpw; @@ -174,6 +175,11 @@ main( int argc, char **argv ) debug = verbose = not = vals2tmp = referrals = attrsonly = manageDSAit = ldif = want_bindpw = 0; + lutil_log_initialize(argc, argv); + lutil_set_debug_level( "LIBLBER", 8 ); + /* log = fopen( "ldapsearch.log", "w" ); */ + /* ber_set_option( NULL, LBER_OPT_LOG_PRINT_FILE, log ); */ + deref = sizelimit = timelimit = version = -1; scope = LDAP_SCOPE_SUBTREE; @@ -728,6 +734,7 @@ main( int argc, char **argv ) return EXIT_FAILURE; } + if ( use_tls && ldap_start_tls_s( ld, NULL, NULL ) != LDAP_SUCCESS ) { if ( use_tls > 1 ) { ldap_perror( ld, "ldap_start_tls" ); -- 2.39.5