dbfdg 3 nma @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 tj|t|jdd|_dS)NZyellow)r__init____name__Z set_prioritylevel)selfr 5/usr/share/setroubleshoot/plugins/catchall_boolean.pyr6s  zplugin.__init__cCsHtj|d}t|tjs(tj|dd}td|dj|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_textc CsVtd|d}y,|dr:|ddkr:|td|d7}Wntk rPYnX|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_textDszplugin.get_then_textcCsv|j|jj}t|jdkrrg}|j}d}|j}x<|D]4}|sL|j|d}|j|j|d|d|fq6W|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