Restorecon 无法应用新标签

问题描述 投票:0回答:0

这真的让我很困惑。 我用SEmanage很久了,从来没有遇到过这种奇怪的问题

# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/www.domain.ext/html(/.*)?'
# restorecon -Rv /var/www/www.domain.ext/html

输出:

/var/www/www.domain.ext/html/1.html not reset as customized by admin to unconfined_u:object_r:httpd_user_content_t:s0
/var/www/www.domain.ext/html/2.html not reset as customized by admin to unconfined_u:object_r:httpd_user_content_t:s0
/var/www/www.domain.ext/html/3.html not reset as customized by admin to unconfined_u:object_r:httpd_user_content_t:s0

/etc/selinux/targeted/contexts/files/file_contexts.local 的内容:

# This file is auto-generated by libsemanage
# Do not edit directly.

/var/www/www.domain.ext/html(/.*)?    system_u:object_r:httpd_sys_rw_content_t:s0

重启后问题依旧

我删除了上下文并重新创建无济于事。

# semanage fcontext -d '/var/www/www.domain.ext/html(/.*)?'
# restorecon -Rv /var/www/www.domain.ext/html
/var/www/www.domain.ext/html/1.html not reset as customized by admin to unconfined_u:object_r:httpd_user_content_t:s0
/var/www/www.domain.ext/html/2.html not reset as customized by admin to unconfined_u:object_r:httpd_user_content_t:s0
/var/www/www.domain.ext/html/3.html not reset as customized by admin to unconfined_u:object_r:httpd_user_content_t:s0
apache centos selinux
© www.soinside.com 2019 - 2024. All rights reserved.