Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Normal
-
Resolution: Fixed
-
Affects Version/s: PUP 2.7.23
-
Fix Version/s: PUP 4.0.0
-
Component/s: Types and Providers
-
Labels:None
-
Template:customfield_10700 55414
Description
I have a file on the system with the following SELinux context
[root@sut ~]# matchpathcon /etc/my-app/my-config.cfg
|
/etc/my-app/my-config.cfg system_u:object_r:my-app_config_t:s0
|
I also have a File["/etc/my-app/my-config.cfg"] resource defined in my manifests, which doesn't call out the seltype attribute, so according the documentation , it should get the type from matchpathcon, and set it to "my-app_config_t".
However, it's setting it to "my" instead.
Oct 16 13:13:43 src@sut puppet-agent[902]: (/File[/etc/my-app/my-config/cfg]/seltype) seltype changed 'etc_t' to 'my'
|
I think I've tracked this down to the regex in parse_selinux_context() in utils/selinux.rb, where the 'type' section of the regexp stops accepting characters at the dash in the "my-app_config_t"
I think it would be better if the regexp were something more lenient , like
/^([^:]+):([^:]+):([^:]+)(?::([a-zA-Z0-9:,._-]+))?/
|
Attachments
Issue Links
- relates to
-
PUP-3849 set_selinux_context needs parameter checks
-
- Accepted
-
- links to