From 7080b68fee1fad5b1f8e14befa9e564269dd8f06 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 24 Jun 2011 13:22:38 -0700 Subject: [PATCH] ITS#6977 fix verbose check in client tools --- CHANGES | 1 + clients/tools/ldapexop.c | 3 ++- clients/tools/ldappasswd.c | 2 +- clients/tools/ldapwhoami.c | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 73a231c05f..753f7c9af7 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ OpenLDAP 2.4.26 Engineering Fixed libldap ASYNC TLS setup (ITS#6828) Fixed libldap with missing \n terminations (ITS#6947) Fixed tools double free (ITS#6946) + Fixed tools verbose output (ITS#6977) Fixed ldapmodify SEGV on invalid LDIF (ITS#6978) Added slapd extra_attrs database option (ITS#6513) Fixed slapd asserts (ITS#6932) diff --git a/clients/tools/ldapexop.c b/clients/tools/ldapexop.c index 316eca1172..6fc4d1e3c6 100644 --- a/clients/tools/ldapexop.c +++ b/clients/tools/ldapexop.c @@ -318,7 +318,8 @@ main( int argc, char *argv[] ) } } - if( verbose || ( code != LDAP_SUCCESS ) || matcheddn || text || refs ) { + if( verbose || code != LDAP_SUCCESS || + ( matcheddn && *matcheddn ) || ( text && *text ) || refs ) { printf( _("Result: %s (%d)\n"), ldap_err2string( code ), code ); if( text && *text ) { diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index a73a767174..81e9c76c95 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -374,7 +374,7 @@ main( int argc, char *argv[] ) } if( verbose || code != LDAP_SUCCESS || - matcheddn || text || refs || ctrls ) + ( matcheddn && *matcheddn ) || ( text && *text ) || refs || ctrls ) { printf( _("Result: %s (%d)\n"), ldap_err2string( code ), code ); diff --git a/clients/tools/ldapwhoami.c b/clients/tools/ldapwhoami.c index e6c2a237eb..4f4c9f6290 100644 --- a/clients/tools/ldapwhoami.c +++ b/clients/tools/ldapwhoami.c @@ -199,8 +199,8 @@ main( int argc, char *argv[] ) skip: ldap_msgfree(res); - if ( verbose || ( code != LDAP_SUCCESS ) || - matcheddn || text || refs || ctrls ) + if ( verbose || code != LDAP_SUCCESS || + ( matcheddn && *matcheddn ) || ( text && *text ) || refs || ctrls ) { printf( _("Result: %s (%d)\n"), ldap_err2string( code ), code ); -- 2.39.2