fedora-selinux / setroubleshoot

Abandoned, use https://gitlab.com/setroubleshoot
https://gitlab.com/setroubleshoot
9 stars 12 forks source link

setroubleshoot: quotes in fix_cmds #34

Open thoger opened 8 years ago

thoger commented 8 years ago

Multiple plugins contain fix_cmd that include quotes, for example:

plugins/src/public_content.py:    fix_cmd = "chcon -t public_content_t '$TARGET_PATH'"

Quotes were needed (but were also insufficient) before 2d126776. After that commit, they actually break those fix commands, causing quotes to be part of arguments seen by the executed commands. As shell is no longer used when executing fix commands, quotes are not consumed by the shell.

Note that none of the plugins that have quotes in fix_cmd also set self.fixable=True, hence commands are not executed by sealert. Quotes need to be removed when affected plugins are marked as fixable.