Bug 592805
Summary: | SELinux is preventing vsftpd from writing files/dirs inside ~/public_html/ | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Ahmed Medhat <ultimatetux> |
Component: | selinux-policy | Assignee: | Miroslav Grepl <mgrepl> |
Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 5.5 | CC: | dwalsh, mmalik, rhel |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Due to an error in SELinux rules, the vsftpd daemon may have been unable to write to a file or create a directory inside ~/public_html/, reporting the following error message:
550 Create directory operation failed.
This update fixes the SELinux rules, and vsftpd now works as expected.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2011-01-13 21:49:41 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Ahmed Medhat
2010-05-17 02:45:58 UTC
Misoslav this should be allowed with the ftp_home_dir boolean turned on. It is in RHEL6 and the latest Fedora policies. In RHEL5 this directory is labeled httpd_sys_content_t and in RHEL6 it is labeled httpd_user_content_t. I think you need to add apache_manage_sys_content(ftpd_t) Within the ftp_home_dir tunable. Ahmed, use audit2allow to add this as custom policy for now. # grep ftp /var/log/audit/audit.log | audit2allow -M myftp # semodule -i myftp.pp (In reply to comment #1) > Misoslav this should be allowed with the ftp_home_dir boolean turned on. For me is ftp_home_dir on and still file upload does not work after upgrading to rhel 5.5 (proftpd server in my case). # getsebool -a | grep ftp_home_dir ftp_home_dir --> on I had to write a custom policy: module proftpdw 1.0; require { type ftpd_t; type httpd_sys_content_t; class dir { rename write rmdir remove_name create add_name }; class file { write rename create unlink setattr }; } #============= ftpd_t ============== allow ftpd_t httpd_sys_content_t:dir { rename write rmdir remove_name create add_name }; allow ftpd_t httpd_sys_content_t:file { write rename create unlink setattr }; I hate when I have to write a policy to fix something that went well before. Well, That worked for me too, however one thing I am still curious about is why when restarting a service from command line takes a different security context than the one initd did gave it and how to fix this, or in another word how to properly restart a service from SELinux point of view so it starts in the proper context. Ah, now here's the context when I create a new dir through FTP.. drwxr-xr-x userid userid system_u:object_r:httpd_sys_content_t testdir And now after restorecon.. drwxr-xr-x userid userid user_u:object_r:httpd_sys_content_t testdir Why isn't the file already created with the proper context ? am I missing something :) ? SELinux is based on transition rules written in policy. unconfined_t @> initrc_file_t -> initrc_t @> ftpd_exec_t -> ftpd_t But we like to keep unconfined unconfined. unconfined_t @> ftpd_exec_t -> unconfined_t You can ignore the user part. system_u indicates that a process started at boot wrote a file label on a file. user_u indicates a process started by a user created the file. For the most part SELinux ignores the user component. (In reply to comment #1) > Misoslav this should be allowed with the ftp_home_dir boolean turned on. It is > in RHEL6 and the latest Fedora policies. In RHEL5 this directory is labeled > httpd_sys_content_t and in RHEL6 it is labeled httpd_user_content_t. > > I think you need to add > > apache_manage_sys_content(ftpd_t) > > Within the ftp_home_dir tunable. > > Ahmed, use audit2allow to add this as custom policy for now. > > # grep ftp /var/log/audit/audit.log | audit2allow -M myftp > # semodule -i myftp.pp Fixed in selinux-policy-2.4.6-283.el5.noarch Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Due to an error in SELinux rules, the vsftpd daemon may have been unable to write to a file or create a directory inside ~/public_html/, reporting the following error message: 550 Create directory operation failed. This update fixes the SELinux rules, and vsftpd now works as expected. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0026.html |