Bug 174485 - gibberish in selinux security context
gibberish in selinux security context
Product: Fedora
Classification: Fedora
Component: findutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Miloslav Trmač
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2005-11-29 10:20 EST by Curtis Doty
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 4.2.27-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-01-12 02:18:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to properly print selinux context (453 bytes, patch)
2005-11-29 10:20 EST, Curtis Doty
no flags Details | Diff

  None (edit)
Description Curtis Doty 2005-11-29 10:20:55 EST
Viewing SELinux security descriptors displayes gibberish.

An example:
$ find /usr/ -maxdepth 1 -printf '%-30Z <-WTF!\t%p\n'

The selinux patch fails to properly set the strlen for the %Z segment but
instead, just blindly shoves an 's' into the format. Attached is a fix.
Comment 1 Curtis Doty 2005-11-29 10:20:56 EST
Created attachment 121585 [details]
patch to properly print selinux context
Comment 2 Tim Waugh 2005-11-29 10:38:08 EST
Can you show me an example of the output you get, compared to the output you
expect?  Thanks.
Comment 3 Curtis Doty 2005-11-29 10:48:13 EST
I just tried the above example on about a half-dozen fedora boxes and it
produced gibberish on *all*--albeit different gibberish on each.

Here is a trimmed down example on the dev box I wrote the patch on:
$ find /usr/ -maxdepth 1 -name 's*' -printf '%-30Z <-WTF!\t%p\n'
system_u:object_r:sbin_t     r <-WTF!   /usr/sbin
system_u:object_r:src_t      r <-WTF!   /usr/src
system_u:object_r:usr_t      r <-WTF!   /usr/share
$ cd ~/src/cvs.fedora.redhat.com/core/devel/findutils/findutils-4.2.26/find/
$ ./find /usr/ -maxdepth 1 -name 's*' -printf '%-30Z YAY\t%p\n'      
system_u:object_r:sbin_t       YAY      /usr/sbin
system_u:object_r:src_t        YAY      /usr/src
system_u:object_r:usr_t        YAY      /usr/share
Comment 4 Miloslav Trmač 2006-01-12 02:18:33 EST
Fixed in rawhide findutils-4.2.27-2. Thanks!

Note You need to log in before you can comment on or make changes to this bug.