Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not be running restorecon like this #107

Closed
TJM opened this issue Aug 9, 2016 · 1 comment
Closed

Should not be running restorecon like this #107

TJM opened this issue Aug 9, 2016 · 1 comment

Comments

@TJM
Copy link
Contributor

TJM commented Aug 9, 2016

I am getting an error when it tries to run restorecon against the path. It should probably not run restorecon against paths like this: /web/[^/]+/\.ssh(/.*)?

Notice: /Stage[main]/Webapp/Selinux::Fcontext[/web/[^/]+/\.ssh(/.*)?]/Exec[add_ssh_home_t_/web/[^/]+/\.ssh(/.*)?]/returns: executed successfully
Info: /Stage[main]/Webapp/Selinux::Fcontext[/web/[^/]+/\.ssh(/.*)?]/Exec[add_ssh_home_t_/web/[^/]+/\.ssh(/.*)?]: Scheduling refresh of Exec[restorecond add_ssh_home_t_/web/[^/]+/\.ssh(/.*)?]
Notice: /Stage[main]/Webapp/Selinux::Fcontext[/web/[^/]+/\.ssh(/.*)?]/Exec[restorecond add_ssh_home_t_/web/[^/]+/\.ssh(/.*)?]/returns: sh: -c: line 0: syntax error near unexpected token `('
Notice: /Stage[main]/Webapp/Selinux::Fcontext[/web/[^/]+/\.ssh(/.*)?]/Exec[restorecond add_ssh_home_t_/web/[^/]+/\.ssh(/.*)?]/returns: sh: -c: line 0: `restorecon /web/[^/]+/\.ssh(/.*)?'
Error: /Stage[main]/Webapp/Selinux::Fcontext[/web/[^/]+/\.ssh(/.*)?]/Exec[restorecond add_ssh_home_t_/web/[^/]+/\.ssh(/.*)?]: Failed to call refresh: restorecon /web/[^/]+/\.ssh(/.*)? returned 1 instead of one of [0]
Error: /Stage[main]/Webapp/Selinux::Fcontext[/web/[^/]+/\.ssh(/.*)?]/Exec[restorecond add_ssh_home_t_/web/[^/]+/\.ssh(/.*)?]: restorecon /web/[^/]+/\.ssh(/.*)? returned 1 instead of one of [0]

I like the idea of running restorecon (sortof), but it needs some help to not expose unescaped special characters to the shell or just not run if it has special characters or something?

~tommy

@TJM TJM changed the title Should not be running restorecon Should not be running restorecon like this Aug 9, 2016
@TJM
Copy link
Contributor Author

TJM commented Aug 9, 2016

OK... so disregard this one. this is easily solved using the restorecond_path parameter in the selinux::fcontext type. It would be "kinda neat" if it was smart enough to "detect" whether there were wildcards in the path, but it would probably almost always do it wrong. When I forked the code to look at #105, I saw the err of my ways.

@TJM TJM closed this as completed Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant