OpenSolaris

Printable Version Enter a New Search
Bug ID 6605670
Synopsis Missing "else" in ldaplist.c:main()
State 10-Fix Delivered (Fix available in build)
Category:Subcategory ldap:tools
Keywords oss-request | oss-sponsor
Sponsor Chin-long Shu
Submitter simhavcs beeresh
Responsible Engineer Chin-long Shu
Reported Against
Duplicate Of
Introduced In solaris_8
Commit to Fix snv_101
Fixed In snv_101
Release Fixed solaris_nevada(snv_101)
Related Bugs
Submit Date 17-September-2007
Last Update Date 22-October-2008
Description
Thanks to John Zolnowsky for pointing out this.

In usr/src/cmd/ldap/ns_ldap/ldaplist.c, function main(),
there is a missing "else" at line 283:

 278                 if (rc == -1 && rc1 == -1) {
 279                         /* this should never happen */
 280                         (void) fprintf(stderr,
 281                             gettext("ldaplist: invalid publickey lookup\n"));
 282                         rc = 2;
 283                 } if (rc != 0 && rc1 != 0) {
 284                         (void) fprintf(stderr,
 285                         gettext("ldaplist: %s\n"), (err ? err : err1));
 286                         if (rc == -1)
 287                                 rc = rc1;
 288                 } else
 289                         rc = 0;
 290                 exit(switch_err(rc));

The "else" should be in line 283, otherwise the intended 
error message "ldaplist: invalid publickey lookup" may
not be printed and rc of 2 may get incorrectly changed
to -1 (when rc == -1 && rc1 == -1 is true).
Work Around
N/A
Comments
N/A