Description of problem: On a filesystem such as NFS that doesn't know how to store SELinux metadata, /bin/cp can create empty target files due to incorrect error handling. Version-Release number of selected component (if applicable): coreutils-6.9-6.fc8 How reproducible: 100% Steps to Reproduce: 1. Go to an NFS-mounted directory that has a non-empty file named 'file1'. 2. Run 'cp -av file1 file2'. 3. Run 'cp -av file1 file2' again. Actual results: file2 is empty Expected results: file2 has same contents as file1 Additional info: Patch is attached that fixes this particular case. However, I would almost argue that all errors generated by fsetfilecon() should be ignored (and not just EOPNOTSUPP), simply because they're not fatal, and because truncating the user's files to zero-length is a really bad outcome for a basic utility like /bin/cp.
Created attachment 243681 [details] Patch to fix this problem
That is more workaround than patch. Anyway - I have a fix for that - so this bug is duplicate of #219900 (patch will hopefully make it into F8 final) *** This bug has been marked as a duplicate of 219900 ***