a èZ` ã@sdddlZejdddZejZddlTddlmZddlZddlTddlZddlZGdd„deƒZ dS) éNzsetroubleshoot-pluginsT)Zfallback)Ú*)ÚPluginc@sTeZdZedƒZdZedƒZdd„ZedƒZdd„Z ed ƒZ d Z d d „Z d d„Z 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. é)Ú_©ÚselfÚavcÚargs©r ú6/usr/share/setroubleshoot/plugins/restorecon_source.pyÚget_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_textrr r r Ú get_if_text>szplugin.get_if_textzyou can run restorecon.z"# /sbin/restorecon -v $SOURCE_PATHcCs0t |t¡| d¡d|_d|_tdƒ|_dS)NédZgreenTzRestore Context)rÚ__init__Ú__name__Z set_priorityÚlevelZfixablerZ button_text)rr r r rDs   zplugin.__init__cCs¨|js dS|jdurdS|jddkr*dSzft |j d¡t¡d}| d¡d}t |j d¡¡d}| d¡d}||krŽ| d|f¡WSWnt y¢Yn0dS)Nrú/ú"rú:é) Zquery_environmentZspathÚselinuxZ matchpathconÚstripÚS_IFREGÚsplitZ getfileconZreportÚOSError)rr ZmconZ mcon_typeZgconZ gcon_typer r r ÚanalyzeKs  zplugin.analyzeN)rÚ __module__Ú __qualname__rZsummaryZfix_cmdZfix_descriptionr rrZ then_textZdo_textrrr r r r r sr) ÚgettextZ translationrZsetroubleshoot.utilZsetroubleshoot.PluginrÚosÚstatrrr r r r Ús