From: Kurt Zeilenga Date: Tue, 29 Dec 1998 05:47:33 +0000 (+0000) Subject: Make LD session options optional. X-Git-Tag: OPENLDAP_REL_ENG_1_1_2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be8cef8a76295fe27a488311636374b630d906d3;p=thirdparty%2Fopenldap.git Make LD session options optional. --- diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index f476af77f7..065dc790de 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -94,15 +94,16 @@ main( int argc, char **argv ) LDAP *ld; infile = NULL; - deref = verbose = allow_binary = not = kerberos = vals2tmp = + verbose = allow_binary = not = kerberos = vals2tmp = attrsonly = ldif = 0; #ifdef LDAP_REFERRALS ldap_options = LDAP_OPT_REFERRALS; #else /* LDAP_REFERRALS */ ldap_options = 0; #endif /* LDAP_REFERRALS */ - sizelimit = timelimit = 0; - scope = LDAP_SCOPE_SUBTREE; + + deref = sizelimit = timelimit = -1; + scope = LDAP_SCOPE_SUBTREE; while (( i = getopt( argc, argv, #ifdef HAVE_KERBEROS @@ -260,9 +261,15 @@ main( int argc, char **argv ) exit( 1 ); } - ld->ld_deref = deref; - ld->ld_timelimit = timelimit; - ld->ld_sizelimit = sizelimit; + if(deref != -1) { + ld->ld_deref = deref; + } + if(timelimit != -1) { + ld->ld_timelimit = timelimit; + } + if(sizelimit != -1) { + ld->ld_sizelimit = sizelimit; + } ld->ld_options = ldap_options; if ( !kerberos ) {