Description of problem: Run restorecon on a large file (libvirt virtual disk): [root@rowlf images]# ls -l OneBigFile.raw -rw-------. 1 root root 17179869184 2010-03-19 13:36 OneBigFile.raw [root@rowlf images]# /sbin/restorecon -v OneBigFile.raw /sbin/restorecon: lstat(OneBigFile.raw) failed: Value too large for defined data type Version-Release number of selected component (if applicable): policycoreutils-2.0.79-1.fc12.i686 How reproducible: Completely. Steps to Reproduce: 1. Run restorecon on a large file. Actual results: Error message from lstat. Expected results: No complaint from lstat. Additional info: Seems restorecon was not built with large file support. chcon _does_ work OK.
Richard does this work if you execute /sbin/restorecon -R -v ../ In the directory with OneBigFile.raw? We are using fts.h which does not like -D_FILE_OFFSET_BITS=64 cc -g -Werror -Wall -W -D_FILE_OFFSET_BITS=64 -I/usr/include -DUSE_AUDIT -c -o setfiles.o setfiles.c In file included from restore.h:6, from setfiles.c:1: /usr/include/fts.h:41:3: error: #error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64" make: *** [setfiles.o] Error 1
/sbin/restorecon -R -v ../ does indeed work.
Any good ideas on how to fix? Maybe change the stat to hard code "file" if the stat call fails with this errno. Since I don't think any other object could get to this size.
Created attachment 401818 [details] Something like this
I'd suggest asking glibc folks how to resolve the conflict between fts(3) and _FILE_OFFSET_BITS=64. We were using _FILE_OFFSET_BITS=64 for setfiles/restorecon when we were still using nftw() before converting to fts().
Created attachment 401826 [details] setfiles/restorecon: Use lstat64 This patch changes setfiles/restorecon to explicitly use struct stat64 and lstat64().
Fixed in policycoreutils-2.0.81-3.fc12
policycoreutils-2.0.81-3.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/policycoreutils-2.0.81-3.fc12
policycoreutils-2.0.81-3.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update policycoreutils'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/policycoreutils-2.0.81-3.fc12
policycoreutils-2.0.82-4.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.