File: //usr/share/setroubleshoot/plugins/allow_anon_write.pyc
�
c�L]c @ s^ d d l Z e j d d e �Z e j Z d d l Td d l m Z d e f d � � YZ d S( i����Ns setroubleshoot-pluginst fallback( t *( t Plugint pluginc B s_ e Z e d � Z e d � Z e d � Z e d � Z e d � Z d � Z d � Z d � Z
RS( s^
SELinux policy is preventing an httpd script from writing to a public
directory.
s�
SELinux policy is preventing an httpd script from writing to a public
directory. If httpd is not setup to write to public directories, this
could signal an intrusion attempt.
s
If httpd scripts should be allowed to write to public directories you need to turn on the $BOOLEAN boolean and change the file context of the public directory to public_content_rw_t. Read the httpd_selinux
man page for further information:
"setsebool -P $BOOLEAN=1; chcon -t public_content_rw_t <path>"
You must also change the default file context labeling files on the system in order to preserve public directory labeling even on a full relabel. "semanage fcontext -a -t public_content_rw_t <path>"
sN If you want to allow $SOURCE_PATH to be able to write to shared public contents� you need to change the label on $TARGET_PATH to public_content_rw_t, and potentially turn on the allow_httpd_sys_script_anon_write boolean.c C s d | } | S( Nso # semanage fcontext -a -t public_content_rw_t $TARGET_PATH
# restorecon -R -v $TARGET_PATH
# setsebool -P %s %s( ( t selft avct argst do_text( ( s5 /usr/share/setroubleshoot/plugins/allow_anon_write.pyt get_do_text/ s
c C s t j | t � d | _ d S( Nt green( R t __init__t __name__t level( R ( ( s5 /usr/share/setroubleshoot/plugins/allow_anon_write.pyR
5 s c C s� | j d g � r� | j | j � r� | j d g � rC | j d � S| j d g � rb | j d � S| j d g � r� | j d � S| j d g � r� | j d � S| j d g � r� | j d � S| j d
g � r� | j d � Sn d S( Nt public_content_tt httpd_tt allow_httpd_anon_writet 1t httpd_sys_script_tt! allow_httpd_sys_script_anon_writet ftpd_tt allow_ftpd_anon_writet nfsd_tt allow_nfsd_anon_writet rsync_tt allow_rsync_anon_writet smbd_tt allow_smbd_anon_write( R R ( R R ( R R ( R R ( R R ( R R ( t matches_target_typest all_accesses_are_int create_file_permst matches_source_typest reportt None( R R ( ( s5 /usr/share/setroubleshoot/plugins/allow_anon_write.pyt analyze9 s
( R t
__module__t _t summaryt problem_descriptiont fix_descriptiont if_textt then_textR R
R! ( ( ( s5 /usr/share/setroubleshoot/plugins/allow_anon_write.pyR s ( t gettextt translationt TrueR# t setroubleshoot.utilt setroubleshoot.PluginR R ( ( ( s5 /usr/share/setroubleshoot/plugins/allow_anon_write.pyt <module> s