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 20:51:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Sweetser 2007-12-04 22:03:44 UTC
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 23:13:09 UTC
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 23:16:03 UTC
Thanks!

Comment 3 Ondrej Vasik 2007-12-05 14:14:01 UTC
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 20:51:45 UTC
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.