]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS #9417 ldapexop exit with correct rc value
authorDing Fei <fei.ding@ustchcs.com>
Fri, 4 Dec 2020 03:11:04 +0000 (11:11 +0800)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 8 Dec 2020 00:09:51 +0000 (00:09 +0000)
`rc` collects exit status all the way down but is not used at all? If `code`
comparison at exit is intended then there exists some path that leaves it in
garbage value, say when `ldap_whoami` or `ldap_cancel` fails.

clients/tools/ldapexop.c

index f4ecf04d0434f41e1edeb90caec027c018ae824f..27ba39669ede7661f2bf3071c744d4fce8f45caa 100644 (file)
@@ -351,5 +351,5 @@ skip:
        /* disconnect from server */
        if ( res )
                ldap_msgfree( res );
-       tool_exit( ld, code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE );
+       tool_exit( ld, rc );
 }