Bug 722591 - SELinux labeling seemingly not correct
Summary: SELinux labeling seemingly not correct
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: wordpress
Version: el6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Remi Collet
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 717790
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-15 18:31 UTC by Patrick C. F. Ernzer
Modified: 2020-11-30 14:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-30 14:59:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Patrick C. F. Ernzer 2011-07-15 18:31:24 UTC
Description of problem:
I just installed wordpress-3.1.4-1.el5 on a CentOS5 box. With default config access to /var/www/html/wp-content fails
[Fri Jul 15 05:26:50 2011] [error] [client 88.115.2.127] File does not exist: /var/www/html/wp-content, referer: http://www.pcfe.net/wordpress/

a bit of searching gave me bug 522897 and indeed setting the selinux label to system_u:object_r:httpd_sys_content_t helps as expected.

Version-Release number of selected component (if applicable):
wordpress-3.1.4-1.el5

How reproducible:
did not try

Steps to Reproduce:
1. have a rather minimal CentOS5 box
2. install wordpress, it's dependencies and mysql-server
3. nail down mysql with /usr/bin/mysql_secure_installation
4. follow /usr/share/doc/wordpress-3.1.4/README.fedora
  
Actual results:
wordpress not fully functional

Expected results:
wordpress works

Additional info:
seeing that Bug 522897 is fixed, this might well be a fluke on this end, want me to reproduce in a KVM guest?

Comment 1 Matěj Cepl 2011-07-15 19:02:20 UTC
Miroslav

Comment 2 Matěj Cepl 2011-07-15 19:07:20 UTC
Sorry, that should be

Miroslav, could you take a look, please?

Comment 3 Miroslav Grepl 2011-07-19 12:14:37 UTC
Patrick, 
what does

# matchpathcon /var/www/html/wp-content

Comment 4 Patrick C. F. Ernzer 2011-07-19 14:55:25 UTC
silly me, in description I should have put /usr/share/wordpress/wp-content which is where the content lives in default config (if I remember correctly)

[root@centos5 ~]# matchpathcon /usr/share/wordpress/wp-content
/usr/share/wordpress/wp-content	system_u:object_r:usr_t
[root@centos5 ~]# ls /var/www/html/wp-content
ls: /var/www/html/wp-content: No such file or directory
[root@centos5 ~]# rpm -qf /var/www/html/wp-content
error: file /var/www/html/wp-content: No such file or directory
[root@centos5 ~]# rpm -ql wordpress|grep www
[root@centos5 ~]# matchpathcon /var/www/html/wp-content
/var/www/html/wp-content	system_u:object_r:httpd_sys_content_t
[root@centos5 ~]# rpm -ql wordpress|grep content|head -n 1
/usr/share/wordpress/wp-content

So if I am not mistaken, the fix would be for wordpress-3.1.4-1.el5 to put wp-content in /var/www/html/ and not /usr/share/wordpress/ and maybe adjust the default config (if my memory of it using the directory under /usr is correct)

Comment 5 Matěj Cepl 2014-01-24 09:47:10 UTC
I have instead this in my semanage fcontext -l -C (showin only the relevant lines):

root@luther: ~# semanage fcontext -C -l
SELinux fcontext                                   type               Context

/usr/share/wordpress/.*\.php$                      all files          system_u:object_r:httpd_sys_script_exec_t:s0 
/usr/share/wordpress/wp-content/.*\.log$           all files          system_u:object_r:httpd_sys_rw_content_t:s0 
/usr/share/wordpress/wp-content/upgrade(/.*)?      all files          system_u:object_r:httpd_sys_rw_content_t:s0 
/usr/share/wordpress/wp-content/wp-plugin(/.*)?    all files          system_u:object_r:httpd_sys_rw_content_t:s0 

SELinux Local fcontext Equivalence 

root@luther: ~#

Comment 12 Ben Cotton 2020-11-05 16:52:18 UTC
This message is a reminder that EPEL 6 is nearing its end of life. Fedora will stop maintaining and issuing updates for EPEL 6 on 2020-11-30. It is our policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of 'el6'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later EPEL version.

Thank you for reporting this issue and we are sorry that we were not able to fix it before EPEL 6 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged  change the 'version' to a later Fedora version prior this bug is closed as described in the policy above.

Comment 13 Ben Cotton 2020-11-05 16:54:58 UTC
This message is a reminder that EPEL 6 is nearing its end of life. Fedora will stop maintaining and issuing updates for EPEL 6 on 2020-11-30. It is policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of 'el6'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later EPEL version.

Thank you for reporting this issue and we are sorry that we were not able to fix it before EPEL 6 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version, you are encouraged to change the 'version' to a later version prior this bug is closed as described in the policy above.

Comment 14 Ben Cotton 2020-11-30 14:59:58 UTC
EPEL el6 changed to end-of-life (EOL) status on 2020-11-30. EPEL el6 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
EPEL please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.