From d76be4828c493e0431b415e016685094e0a6778f Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 23 Jun 2011 17:10:37 -0700 Subject: [PATCH] ITS#6977 fix verbose check in client tools --- clients/tools/ldapexop.c | 3 ++- clients/tools/ldappasswd.c | 2 +- clients/tools/ldapvc.c | 4 ++-- clients/tools/ldapwhoami.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) 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/ldapvc.c b/clients/tools/ldapvc.c index 49ac406aa0..73166b1d8e 100644 --- a/clients/tools/ldapvc.c +++ b/clients/tools/ldapvc.c @@ -469,8 +469,8 @@ main( int argc, char *argv[] ) } skip: - 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 ); 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.5