<div dir="ltr"><div><div><div><div><br clear="all"></div>Hi, I&#39;m playing with my web server and found a strange incident.<br><br></div>I try to enable write to certain directory in /var/www/dir in SELinux way.<br><br></div>
I know that fancy way of doing this is to type,<br><br></div># semanage fcontext -a -t httpd_sys_rw_content_t /var/www/dir<br><div><div><div><div><br></div><div>After successfully added rw type to directory, I will type<br>
<br></div><div># restorecon -rv /var/www<br><br></div><div>It works fine.<br><br></div><div>But, when I name the very directory &quot;/var/www/Dir&quot; not &quot;/var/www/dir&quot; <br><br></div><div>first command works fine and I could see by<br>
<br></div><div># semanage fcontext -l |grep &quot;/var/www&quot;<br><br></div><div>The rw type is set allright.<br><br></div><div>BUT, when I restorecon the /var/www, nothing happens and with force option, no use.<br><br>
</div><div>Is this a bug on &quot;semanage fcontext&quot; or my box is broken?<br><br></div><div>My solution now is just name the directory &quot;/var/www/dir&quot; and post this question.<br><br></div><div>Thanks.<br></div>
<div><br>[root@xxxx]# sestatus<br>SELinux status:                 enabled<br>SELinuxfs mount:                /sys/fs/selinux<br>SELinux root directory:         /etc/selinux<br>Loaded policy name:             targeted<br>Current mode:                   enforcing<br>
Mode from config file:          enforcing<br>Policy MLS status:              enabled<br>Policy deny_unknown status:     allowed<br>Max kernel policy version:      28<br><br>[root@xxxx]# rpm -qa|grep selinux<br>selinux-policy-3.12.1-119.fc20.noarch<br>
libselinux-2.2.1-6.fc20.x86_64<br>libselinux-utils-2.2.1-6.fc20.x86_64<br>selinux-policy-targeted-3.12.1-119.fc20.noarch<br>libselinux-python-2.2.1-6.fc20.x86_64<br>php-pecl-selinux-0.3.1-12.fc20.x86_64<br>libselinux-devel-2.2.1-6.fc20.x86_64<br>
<br><br></div><div><br></div><div>-- <br><div dir="ltr"><div><br>&quot;segatex&quot; SELinux tool<br><br><a href="http://sourceforge.net/projects/segatex/" target="_blank">http://sourceforge.net/projects/segatex/</a><br></div>
<br></div>
</div></div></div></div></div>