Full_Name: W. Michael Petullo Version: 2.3.19 OS: Fedora Core 5 URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (63.13.194.34) 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." 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.
--On Saturday, March 25, 2006 8:22 PM +0000 openldap@flyn.org wrote: > Full_Name: W. Michael Petullo > Version: 2.3.19 > OS: Fedora Core 5 > URL: ftp://ftp.openldap.org/incoming/ > Submission from: (NULL) (63.13.194.34) > > > 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." > > 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. Or maybe the man page is wrong, and it should say it should go to standard out. --Quanah -- Quanah Gibson-Mount Principal Software Developer ITS/Shared Application Services Stanford University GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
Hi, the attached patch should fix the issue: --- ldapdelete.c 2006-01-03 23:16:01.000000000 +0100 +++ ldapdelete.c 2006-03-26 13:58:12.000000000 +0200 @@ -263,12 +263,12 @@ return rc; } - if( verbose || code != LDAP_SUCCESS || - (matcheddn && *matcheddn) || (text && *text) || (refs && *refs) ) - { - printf( _("Delete Result: %s (%d)\n"), - ldap_err2string( code ), code ); + if (code != LDAP_SUCCESS) { + fprintf( stderr, "%s: delete result: %s (%d)\n", + prog, ldap_err2string( code ), code ); + } + if( verbose ) { if( text && *text ) { printf( _("Additional info: %s\n"), text ); } Hope it helps Peter -- Peter Marschall eMail: peter@adpm.de
openldap@flyn.org wrote: > Full_Name: W. Michael Petullo > Version: 2.3.19 > OS: Fedora Core 5 > URL: ftp://ftp.openldap.org/incoming/ > Submission from: (NULL) (63.13.194.34) > > > 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." > > 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. It looks like there's more problems here; when the "verbose" option is used ldapmodify and ldapdelete print a message that the operation was completed after the request was successfully sent to the server, but before reading the server's reply. I would expect that the "completed" message should not be printed until after we know the server successfully processed the request. -- -- Howard Chu Chief Architect, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc OpenLDAP Core Team http://www.openldap.org/project/
Hi Howard, plaese apply the patch as it fixes the issue in the bug report. ("prints error messages to stdout") and create another bug report for the problem you found. Unfortunately my knowledge about the LDAP C API is not good enough to solve this problem as well. Thanks in advance for applying the patch Peter -- Peter Marschall | eMail: peter.marschall@adpm.de Scheffelstraße 15 | Tel: +49 931 14721 D-97072 Würzburg | PGP: 0BB1 04A3 0FB0 E27F 8018 52BA A286 7B23 9C22 2C83
changed notes changed state Open to Test moved from Incoming to Software Bugs
changed notes changed state Test to Release
changed state Release to Closed
moved from Software Bugs to Archive.Software Bugs
fixed in HEAD/re23