RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1499259 - semanage fcontext "-f/--ftype" description is broken
Summary: semanage fcontext "-f/--ftype" description is broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: policycoreutils
Version: 7.4
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Vit Mojzis
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-06 13:40 UTC by Renaud Métrich
Modified: 2018-04-10 16:38 UTC (History)
8 users (show)

Fixed In Version: policycoreutils-2.5-22.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 16:38:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0913 0 None None None 2018-04-10 16:38:10 UTC

Description Renaud Métrich 2017-10-06 13:40:09 UTC
Description of problem:

semanage fcontext --help shows the following for "-f/--ftype":

  -f {a,f,d,c,b,s,l,p}, --ftype {a,f,d,c,b,s,l,p}
                        File Type. This is used with fcontext. Requires a file
                        type as shown in the mode field by ls, e.g. use -d to
                        match only directories or -- to match only regular
                        files. The following file type options can be passed:
                        -- (regular file),-d (directory),-c (character
                        device), -b (block device),-s (socket),-l (symbolic
                        link),-p (named pipe) If you do not specify a file
                        type, the file type will default to "all files".

The expected character (a, f, d, c, ...) differs from the actual text.
For example to match a regular file, "f" should be used instead of "--".
Also, the first dash in option should be removed (e.g. "-d" -> "d").

The manpage is accurrate.


Version-Release number of selected component (if applicable):

policycoreutils-python-2.2.5-21.el7_2.x86_64

Comment 2 Milos Malik 2017-10-06 14:12:34 UTC
You're right. Manually executed semanage fcontext ... confirms following mapping:

-f a -> all files
-f b -> block device
-f c -> character device
-f f -> regular file
-f d -> directory
-f l -> symbolic link
-f p -> named pipe
-f s -> socket
without -> all files

Comment 9 errata-xmlrpc 2018-04-10 16:38:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0913


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