The ksh builtins fail to report errors on failed file operations, e.g.: echo "something" > /mnt/filesystem/file.txt Will not report an error and would have zero return code even if "/mnt/filesystem" was full and the file.txt could not be written to. This problem seems to be present even in the latest upstream version and is caused by not checking the return codes of sfsync/sfwrite/sfclose functions. Excerpt from src/cmd/ksh93/bltins/print.c: 342 else if(n&SF_SHARE) 343 { 344 sfset(outfile,SF_SHARE|SF_PUBLIC,1); 345 sfsync(outfile); 346 } 347 return(exitval); Note the line 345: if sfsync fails, the builtins print printf or echo would still return no error which may lead to data loss. The return codes of sfsync/sfclose or sfwrite should not be ignored and any error should be indicated to the user with a proper return code of the command and an error message.
Created attachment 320455 [details] patch against ksh-20080202 patch against ksh-20080202 (rebased version in oncoming RHEL 5.3)
(In reply to comment #1) > Created an attachment (id=320455) [details] > patch against ksh-20080202 > > patch against ksh-20080202 (rebased version in oncoming RHEL 5.3) Customer tested this patch and confirmed that it fixes their problems.
Release note added. If any revisions are required, please set the "requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: The ksh builtins fail to report errors on failed file operations, for example, they would not report an error if they were unable to write to a file because of no space on a disk. This could result in data loss, because a user would have no warning that data was not saved. Builtins now provide a proper return code and present an error message to the user if they are unable to complete a file operation. This prevents the user from incorrectly assuming that the file operation has completed correctly in cases where it has not.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1256.html