[PUP-3849] set_selinux_context needs parameter checks Created: 2015/01/14  Updated: 2018/05/21

Status: Accepted
Project: Puppet
Component/s: Types and Providers
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Kylo Ginsberg Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: linux, selinux, type_and_provider
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PUP-3481 Regex problem with an SELinux context... Closed
Template:
Team: Platform OS
QA Contact: Eric Thompson

 Description   

Snippet from PR review

I'm more concerned abut the set_selinux_context() function, where the 'value' argument isn't being checked for whitespace or colons. At around line 97, if 'value' includes a colon, then when the context is split up based on the colons and joined back together again, the components in the context string will pushed to the left by the new colon added by 'value'. Puppet then gives a cryptic 'can't set the SELinux context' error instead of a better 'SELinux components can't include whitespace or colons' error.

Note when component is false, when value is the entire context replacement string, which can include whitespace in the MLS section will include colons between components, so any checks on value should be in the 'then' clause ~ line 88.


Generated at Sat Dec 14 16:36:40 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.