Bug 788046

Summary: SELINUX: semanage boolean failed due to invalid regex
Product: [Fedora] Fedora Reporter: Avi Tal <atal>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, mgrepl, srevivo, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-17 06:36:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Avi Tal 2012-02-07 10:40:02 UTC
libselinux-2.1.6-5.fc16.x86_64
libselinux-python-2.1.6-5.fc16.x86_64
selinux-policy-3.10.0-75.fc16.noarch
libselinux-utils-2.1.6-5.fc16.x86_64
selinux-policy-targeted-3.10.0-75.fc16.noarch


Description of problem:
# /usr/sbin/semanage boolean -m -S targeted -F /dev/stdin
/etc/selinux/targeted/contexts/files/file_contexts.local:  line 4 has invalid regex /etc/sysconfig/network-scripts/ifcfg-(*)?:  Invalid preceding regular expression


# cat /etc/selinux/targeted/contexts/files/file_contexts.local

# This file is auto-generated by libsemanage
# Do not edit directly.

/etc/sysconfig/network-scripts/ifcfg-(*)?    system_u:object_r:net_conf_t:s0
/etc/sysconfig/network-scripts/ifcfg-ovirtmgmt    system_u:object_r:net_conf_t:s0

Comment 1 Miroslav Grepl 2012-02-07 11:19:12 UTC
How did you add the first definition?

$ semanage fcontext -a -t net_conf_t "/etc/sysconfig/network-scripts/ifcfg-(*)"
/etc/selinux/targeted/contexts/files/file_contexts.local:  line 4 has invalid regex /etc/sysconfig/network-scripts/ifcfg-(*):  Invalid preceding regular expressio

Comment 2 Miroslav Grepl 2012-02-07 11:21:39 UTC
Ahh, I see "/etc/selinux/targeted/contexts/files/file_contexts.local" is updated and this labeling is added which causes issues.

You will need to delete it from this file by hand.

Comment 3 Daniel Walsh 2012-02-07 14:45:59 UTC
Miroslav are you saying the semanage command allowed the bad data in?

Comment 4 Miroslav Grepl 2012-02-07 14:54:01 UTC
(In reply to comment #3)
> Miroslav are you saying the semanage command allowed the bad data in?

Yes. But I have not looked at it yet.

Comment 5 Daniel Walsh 2012-10-16 17:43:59 UTC
Miroslav going through old bugs, is this one fixed?

Comment 6 Miroslav Grepl 2012-10-17 06:36:01 UTC
Yes, we fixed it.