Bug 411181

Summary: %C output format (selinux file security context) of stat broken
Product: [Fedora] Fedora Reporter: Frank Sweetser <fs>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 6.9-12.fc8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-06 15:51:47 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Frank Sweetser 2007-12-04 17:03:44 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
system_u:object_r:ls_exec_t

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
%=s

This is on a Fedora 8 system with all patches as of 12/4/2007 applied.
Comment 1 Ondrej Vasik 2007-12-04 18:13:09 EST
Thanks for report, solution of problem found in upstream, fix will be pushed to
rawhide and F8 tomorrow.
Comment 2 Frank Sweetser 2007-12-04 18:16:03 EST
Thanks!
Comment 3 Ondrej Vasik 2007-12-05 09:14:01 EST
Built as coreutils-6.9-12.fc8 - bug will get closed after the push of package to
stable F8.
Comment 4 Fedora Update System 2007-12-06 15:51:45 EST
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.