Yeah, I just decided to do the same test as the two enclosed if statements to be 100% compatible.
Chris On 2011/06/23 13:31, Howard Chu wrote: > [email protected] wrote: >> Full_Name: Chris Hecker >> Version: 2.4.25 >> OS: centos 5.6 >> URL: ftp://ftp.openldap.org/incoming/ >> Submission from: (NULL) (98.248.126.162) >> >> >> Hi, ldapwhoami erroneously prints the "Result: Success (0)" string >> even if -v is >> not specified due to a minor bug in the code. Here is a fix. I am running >> 2.3.43, but just checked the latest repository version and the bug is >> still >> there (although at line 203 now), so I marked the version above as >> latest. >> >> Thanks, >> Chris > > It seems to me the better fix would be to change ldap_parse_result() to > not populate matcheddn or text when their values are zero-length. Kurt, > any particular reason things should continue to work as they currently do? > >> >> --- old/openldap-2.3.43/clients/tools/ldapwhoami.c 2008-02-11 >> 17:24:07.000000000 -0600 >> +++ openldap-2.3.43/clients/tools/ldapwhoami.c 2011-06-21 >> 14:15:28.000000000 >> -0500 >> @@ -215,7 +215,7 @@ >> >> skip: >> if ( verbose || ( code != LDAP_SUCCESS ) || >> - matcheddn || text || refs || ctrls ) >> + (matcheddn&& *matcheddn) || (text&& *text) || refs || ctrls ) >> { >> printf( _("Result: %s (%d)\n"), ldap_err2string( code ), code >> ); >> >> >> > >
