OpenSolaris

Printable Version Enter a New Search
Bug ID 6589364
Synopsis ldapsearch exits with incorrect return value when output is redirected to a file system that is full
State 10-Fix Delivered (Fix available in build)
Category:Subcategory ldap:tools
Keywords rtiq_reviewed
Responsible Engineer Sreedhar Chalamalasetti
Reported Against snv_70
Duplicate Of
Introduced In solaris_8
Commit to Fix snv_104
Fixed In snv_104
Release Fixed solaris_nevada(snv_104) , solaris_10u7(s10u7_05) (Bug ID:2165248)
Related Bugs 6606983 , 6683362 , 6765963
Submit Date 5-August-2007
Last Update Date 4-December-2008
Description
ldapsearch does not check for the correct return value when its output is redirected
to a file system that has no space left. The $? value shows up as 0 even though
the output has not been written to the file.
Work Around
Pipe the output of ldapsearch with a command that correcly handle error printing to stdout, such as cat(1). Using the example given in comments, that would give something like:


# ldapsearch -h 10.5.60.36 -p 389  -b dc=example,dc=com "objectclass=*" dn | cat > ldap_output.txt          
cat: output error (0/6731 characters written)
No space left on device
# echo $?
2
#
Comments
N/A