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 845288 - semanage fcontext accepts paths with double slash but the entry is invalid
Summary: semanage fcontext accepts paths with double slash but the entry is invalid
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: policycoreutils
Version: 6.3
Hardware: All
OS: All
medium
medium
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-02 14:53 UTC by Miroslav Vadkerti
Modified: 2012-10-15 11:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-15 11:18:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Miroslav Vadkerti 2012-08-02 14:53:21 UTC
Description of problem:
After adding a path with double slash with semanage fcontext the added path doesn't get the wanted context

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

How reproducible:
100%

Steps to Reproduce:
# mkdir /tmp/test
# touch /tmp/test/a
# touch /tmp/test/b
# semanage fcontext -a -t var_log_t "/tmp//test(/.*)?"
# restorecon -RvvF /tmp/test/
(nothing happens)
# ll -Z /tmp/test/a 
-rw-r--r--. root root unconfined_u:object_r:user_tmp_t:s0 /tmp/test/a
  
Actual results:
Double slash paths are invalid

Expected results:
Semanage should convert directly subsequent slashes to one slash only, or work well with more directly subsequent slashes 

Additional info:

Comment 1 Daniel Walsh 2012-08-02 20:26:17 UTC
That is someone tough to do. I guess we could do a realpath on /tmp//test somehow if we can figure out where the path get screwed up.

/tmp/../test(/.*)?

IE There are a lot of paths that regex will not complain about, but this is somewhat the problem of the user.  Currently the tool is checking for spaces so we could add "//" as being invalid, I am not sure what else we should look for,

Comment 2 Miroslav Grepl 2012-10-15 11:18:21 UTC
I am going to close this one for now as CANTFIX. Let's look if we can find a solution in Fedora first.


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