Red Hat Bugzilla – Bug 186621
ldapdelete prints error message to stdout
Last modified: 2014-08-31 19:28:16 EDT
Description of problem:
The ldapdelete command prints its error message to standard out. However, the
manpage states, "Exit status is 0 if no errors occur. Errors result in a
non-zero exit status and a diagnostic message being written to standard error."
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Try to delete an LDAP object that does not exist; execute a command like:
ldapdelete -x -D cn=Manager,dc=flyn,dc=org -W "cn=Domain
Users,ou=Group,dc=flyn,dc=org" 2> /dev/null
2. Execute "echo $?" to confirm exit status is non-zero.
3. Notice that ldapdelete printed error to standard out.
The following was printed:
Delete Result: No such object (32)
Matched DN: ou=group,dc=flyn,dc=org
The exit status was non-zero. According to the manpage the error message should
go to standard error.
See also http://www.openldap.org/its/index.cgi?findid=4453.
It seems to be fixed in the latest stable upstream 2.3.24 ...
[mike@imp ~]$ ldapdelete -x -D cn=Manager,dc=flyn,dc=org -W "cn=Domain
Users,ou=Group,dc=flyn,dc=org" > /dev/null
Enter LDAP Password:
ldap_delete: No such object (32)
matched DN: ou=group,dc=flyn,dc=org
Notice that the error message now goes to stderr.