Red Hat Bugzilla – Bug 411181
%C output format (selinux file security context) of stat broken
Last modified: 2007-12-06 15:51:47 EST
According to the manpage for format, --format=%C should display the selinux
security context of a given file.
On Fedora 7, the output makes sense and agrees with ls -Z:
[fs@avocent ~]$ ls -Z /bin/ls
-rwxr-xr-x root root system_u:object_r:ls_exec_t /bin/ls
[fs@avocent ~]$ stat --format=%C /bin/ls
On Fedora 8, however, stat produces what appears to be a few bytes of garbage
that varies from file to file:
[root@gkar ~]# ls -Z /bin/ls
-rwxr-xr-x root root system_u:object_r:bin_t /bin/ls
[root@gkar ~]# stat --format=%C /bin/ls
This is on a Fedora 8 system with all patches as of 12/4/2007 applied.
Thanks for report, solution of problem found in upstream, fix will be pushed to
rawhide and F8 tomorrow.
Built as coreutils-6.9-12.fc8 - bug will get closed after the push of package to
coreutils-6.9-12.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.