a Z` @s\ddlZddlZddlZejdddZejZddlTddlmZddlZGdddeZ dS) Nzsetroubleshoot-pluginsT)Zfallback)*)Pluginc@sPeZdZedZedZedZdZddZddZ d d Z d d Z d dZ dS)pluginzN SELinux is preventing $SOURCE_PATH "$ACCESS" access on $TARGET_PATH. a: SELinux denied access requested by $SOURCE. The current boolean settings do not allow this access. If you have not setup $SOURCE to require this access this may signal an intrusion attempt. If you do intend this access you need to change the booleans on this system to allow the access. z Confined processes can be configured to run requiring different access, SELinux provides booleans to allow you to turn on/off access as needed. cCs t|t|dd|_dS)NZyellow)r__init____name__Z set_prioritylevel)selfr 5/usr/share/setroubleshoot/plugins/catchall_boolean.pyr6s  zplugin.__init__cCsHt|d}t|tjs(tj|dd}td|d|ddS)Nrutf8)encodingzIf you want to %s)sepolicyZ boolean_desc isinstancesixZ text_type_lower)r avcargsZtxtr r r get_if_text;s zplugin.get_if_textcCstd|d|dfS)Nzsetsebool -P %s %srr)r)r rrr r r get_do_textAszplugin.get_do_textcCsTtd|d}z,|dr:|ddkr:|td|d7}WntyNYn0|S)Nz?You must tell SELinux about this by enabling the '%s' boolean. rNonez,You can read '%s' man page for more details.)r IndexError)r rrtextr r r get_then_textDs zplugin.get_then_textcCsr||jj}t|jdkrng}|j}d}|j}|D]4}|sJ||d}|||d|d|fq4|SdS)Nrrr)Z check_for_manZscontexttypelenboolsfix_descriptionappendZreport)r rZman_pageZreportsZfixfix_cmdr br r r analyzeNs zplugin.analyzeN) r __module__ __qualname__rZsummaryZproblem_descriptionr!r#rrrrr%r r r r r s  r) gettextosrZ translationrZsetroubleshoot.utilZsetroubleshoot.Pluginrrrr r r r s