And I cannot delete context either.

Although I can see by semanage fcontext -l , SELinux says I have not set "/var/www/Dir" context at all.


2014-02-08 Shintaro Fujiwara <shintaro.fujiwara@gmail.com>:

Hi, I'm playing with my web server and found a strange incident.

I try to enable write to certain directory in /var/www/dir in SELinux way.

I know that fancy way of doing this is to type,

# semanage fcontext -a -t httpd_sys_rw_content_t /var/www/dir

After successfully added rw type to directory, I will type

# restorecon -rv /var/www

It works fine.

But, when I name the very directory "/var/www/Dir" not "/var/www/dir"

first command works fine and I could see by

# semanage fcontext -l |grep "/var/www"

The rw type is set allright.

BUT, when I restorecon the /var/www, nothing happens and with force option, no use.

Is this a bug on "semanage fcontext" or my box is broken?

My solution now is just name the directory "/var/www/dir" and post this question.

Thanks.

[root@xxxx]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

[root@xxxx]# rpm -qa|grep selinux
selinux-policy-3.12.1-119.fc20.noarch
libselinux-2.2.1-6.fc20.x86_64
libselinux-utils-2.2.1-6.fc20.x86_64
selinux-policy-targeted-3.12.1-119.fc20.noarch
libselinux-python-2.2.1-6.fc20.x86_64
php-pecl-selinux-0.3.1-12.fc20.x86_64
libselinux-devel-2.2.1-6.fc20.x86_64






--
日本にヘヴィメタル・ハードロックを根付かせるページ
http://www.heavymetalhardrock.tk/

世界中でセキュアOSのSELinuxを使いやすくするフリーソフト
http://sourceforge.net/projects/segatex/

CMS(PHPとPostgreSQLを使ったフリーソフト)
http://sourceforge.net/projects/webon/