dbfdg 3 nma @sdddlZejdddZejZddlTddlmZddlZddlTddlZddlZGdddeZ dS) Nzsetroubleshoot-pluginsT)Zfallback)*)Pluginc@sTeZdZedZdZedZddZedZddZ ed Z d Z d d Z d dZ dS)pluginzN SELinux is preventing $SOURCE_PATH "$ACCESS" access to $TARGET_PATH. z/sbin/restorecon $SOURCE_PATHz You can restore the default system context to this file by executing the restorecon command. restorecon '$SOURCE_PATH'. cCstd|dS)Nam SELinux denied access requested by $SOURCE. $SOURCE_PATH may be mislabeled. $SOURCE_PATH default SELinux type is %s, but its current type is $SOURCE_TYPE. Changing this file back to the default type may fix your problem.

This file could have been mislabeled either by user error, or if an normally confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not have been labeled with this type.

If you believe this is a bug, please file a bug report against this package. )_)selfavcargsr 6/usr/share/setroubleshoot/plugins/restorecon_source.pyget_problem_description,s zplugin.get_problem_descriptionzGIf you want to fix the label. $SOURCE_PATH default label should be %s.cCs|j|dS)Nr)if_text)rrr r r r get_if_text>szplugin.get_if_textzyou can run restorecon.z"# /sbin/restorecon -v $SOURCE_PATHcCs0tj|t|jdd|_d|_td|_dS)NdZgreenTzRestore Context)r__init____name__Z set_prioritylevelZfixablerZ button_text)rr r r rDs   zplugin.__init__c Cs|js dS|jdkrdS|jddkr*dSydtj|jjdtd}|jdd}tj|jjdd}|jdd}||kr|jd|fSWnt k rYnXdS)Nr/"r:) Zquery_environmentZspathselinuxZ matchpathconstripS_IFREGsplitZ getfileconZreportOSError)rrZmconZ mcon_typeZgconZ gcon_typer r r analyzeKs  zplugin.analyzeN)r __module__ __qualname__rZsummaryZfix_cmdZfix_descriptionr r rZ then_textZdo_textrrr r r r r sr) gettextZ translationrZsetroubleshoot.utilZsetroubleshoot.Pluginrosstatrrr r r r s