If you want to fix the label. /var/www/html/ow_pluginfiles/base/lang_3.php default label should be httpd_sys_content_t. Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly. Do # /sbin/restorecon -v /var/www/html/ow_pluginfiles/base/lang_3.php
If you believe that httpd should be allowed setattr access on the lang_3.php file by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # ausearch -c 'httpd' --raw | audit2allow -M my-httpd # semodule -i my-httpd.pp
Additional Information: Source Context system_u:system_r:httpd_t:s0 Target Context unconfined_u:object_r:user_home_t:s0 Target Objects /var/www/html/ow_pluginfiles/base/lang_3.php [ file ] Source httpd Source Path /usr/sbin/httpd Port <Unknown> Host localhost.localdomain Source RPM Packages httpd-2.4.6-80.el7.centos.1.x86_64 Target RPM Packages Policy RPM selinux-policy-3.13.1-192.el7_5.6.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name sn.scu.ac.ir Platform Linux sn.scu.ac.ir 3.10.0-862.11.6.el7.x86_64 #1 SMP Tue Aug 14 21:49:04 UTC 2018 x86_64 x86_64 Alert Count 4 First Seen 2018-11-08 12:47:44 +0330 Last Seen 2018-11-08 12:47:45 +0330 Local ID 3abcf430-043b-4d78-ba62-91c14416a2d5
Raw Audit Messages type=AVC msg=audit(1541668665.173:28113): avc: denied { setattr } for pid=24134 comm="httpd" name="lang_3.php" dev="dm-0" ino=2316067 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file