Bug 435140

Summary: SELinux Administration utility doesn't handle file specificatoins correctly
Product: Red Hat Enterprise Linux 5 Reporter: David A. Cafaro <dac>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: low    
Version: 5.1CC: dwalsh, mkoci, pgraner
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 22:00:34 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 David A. Cafaro 2008-02-27 16:32:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12

Description of problem:
When using the GUI SELinux Administration toole (system-config-selinux) to add File Labeling objects you are unable to enter in (/.*)? at the end of a file path.

The error you get is:

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: `{ semanage fcontext -a -t mysqld_db_t -r so -f 'all files' /home/database/mysql(/.*)?; } 2>&1'

If you run semanage manually on the command line adding single quotes to the file path, the command works properly and the context is added, example:

[root@server ~]# semanage fcontext -a -t mysqld_db_t -r so -f 'all files' '/home/database/mysql(/.*)?'
[root@server ~]# 

Version-Release number of selected component (if applicable):
policycoreutils-gui-1.33.12012.el5

How reproducible:
Always


Steps to Reproduce:
1. Load SELinux Administration
2. Try to add a new file context to File Labeling that contains (/.*)? at the end
3. What the error window pop up 
(system-config-selinx must be launched from the command line to easily see the error listed in the terminal as the gui pop-up windows just has a red stop sign and OK button)

Actual Results:
The context was not added, and I received an error.

Expected Results:
the context should have been added

Additional info:
Looks like the context string just needs to be placed in single quotes before being sent to the command line.

Comment 1 Daniel Walsh 2008-02-28 14:57:50 UTC
Fixed in policycoreutils-1.33.12-15.el5.src.rpm

Possible release via zstream?

Comment 2 RHEL Program Management 2008-06-04 22:46:21 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Daniel Walsh 2008-09-17 19:11:53 UTC
Fixed in policycoreutils-1.33.12-14.1.el5

Comment 8 errata-xmlrpc 2009-01-20 22:00:34 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0206.html