Description of problem: While working on investigation of bug 891547, I also checked Fedora 16 and I found it strange that the restorecon -rvv /var/lib/pgsql/data/pg_log does not report anything and that the log file stays of the type postgresql_db_t. # ls -laZ /var/lib/pgsql/data/pg_log/ drwx------. postgres postgres unconfined_u:object_r:postgresql_db_t:s0 . drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 .. -rw-------. postgres postgres system_u:object_r:postgresql_db_t:s0 postgresql-Thu.log I thought maybe the postgresql_log_t type is not there in Fedora at all, but grep showed otherwise: # grep pgsql /etc/selinux/targeted/contexts/files/file_contexts | grep log /var/lib/pgsql/.*\.log system_u:object_r:postgresql_log_t:s0 /var/lib/pgsql/logfile(/.*)? system_u:object_r:postgresql_log_t:s0 /var/lib/sepgsql/pgstartup\.log -- system_u:object_r:postgresql_log_t:s0 Alas, there is also /var/lib/pgsql/data(/.*)? system_u:object_r:postgresql_db_t:s0 which presumably takes precedence. Version-Release number of selected component (if applicable): # rpm -qf /etc/selinux/targeted/contexts/files/file_contexts selinux-policy-targeted-3.10.0-96.fc16.noarch How reproducible: Deterministic. Steps to Reproduce: 1. ls -laZ /var/lib/pgsql/data/pg_log 2. restorecon -rvv /var/lib/pgsql/data/pg_log 3. ls -laZ /var/lib/pgsql/data/pg_log Actual results: # ls -laZ /var/lib/pgsql/data/pg_log drwx------. postgres postgres unconfined_u:object_r:postgresql_db_t:s0 . drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 .. -rw-------. postgres postgres system_u:object_r:postgresql_db_t:s0 postgresql-Thu.log # restorecon -rvv /var/lib/pgsql/data/pg_log # ls -laZ /var/lib/pgsql/data/pg_log drwx------. postgres postgres unconfined_u:object_r:postgresql_db_t:s0 . drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 .. -rw-------. postgres postgres system_u:object_r:postgresql_db_t:s0 postgresql-Thu.log # Expected results: # ls -laZ /var/lib/pgsql/data/pg_log drwx------. postgres postgres unconfined_u:object_r:postgresql_db_t:s0 . drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 .. -rw-------. postgres postgres system_u:object_r:postgresql_db_t:s0 postgresql-Thu.log # restorecon -rvv /var/lib/pgsql/data/pg_log restorecon reset /var/lib/pgsql/data/pg_log/postgresql-Thu.log context system_u:object_r:postgresql_db_t:s0->system_u:object_r:postgresql_log_t:s0 # ls -laZ /var/lib/pgsql/data/pg_log drwx------. postgres postgres unconfined_u:object_r:postgresql_db_t:s0 . drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 .. -rw-------. postgres postgres system_u:object_r:postgresql_log_t:s0 postgresql-Thu.log # or # ls -laZ /var/lib/pgsql/data/pg_log drwx------. postgres postgres unconfined_u:object_r:postgresql_db_t:s0 . drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 .. -rw-------. postgres postgres system_u:object_r:postgresql_db_t:s0 postgresql-Thu.log # restorecon -rvv /var/lib/pgsql/data/pg_log restorecon reset /var/lib/pgsql/data/pg_log context system_u:object_r:postgresql_db_t:s0->system_u:object_r:postgresql_log_t:s0 restorecon reset /var/lib/pgsql/data/pg_log/postgresql-Thu.log context system_u:object_r:postgresql_db_t:s0->system_u:object_r:postgresql_log_t:s0 # ls -laZ /var/lib/pgsql/data/pg_log drwx------. postgres postgres unconfined_u:object_r:postgresql_log_t:s0 . drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 .. -rw-------. postgres postgres system_u:object_r:postgresql_log_t:s0 postgresql-Thu.log # Additional info:
Added fixes from F18. commit 222eed0a61307b58c91aeb4f58041fe84f86af53 Author: Miroslav Grepl <mgrepl> Date: Fri Jan 4 09:27:48 2013 +0100 Add interface for postgesql_filetrans_name_content to make sure log directories get created with the correct label.
selinux-policy-3.10.0-98.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-98.fc16
Package selinux-policy-3.10.0-98.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-98.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-0230/selinux-policy-3.10.0-98.fc16 then log in and leave karma (feedback).
This message is a reminder that Fedora 16 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '16'. 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 Fedora version prior to Fedora 16's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 16 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 to click on "Clone This Bug" and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
# ls -laZ /var/lib/pgsql/data/pg_log drwx------. postgres postgres unconfined_u:object_r:postgresql_log_t:s0 . drwx------. postgres postgres system_u:object_r:postgresql_db_t:s0 .. -rw-------. postgres postgres system_u:object_r:postgresql_log_t:s0 postgresql-Thu.log VERIFIED.
Thank you for testing.
selinux-policy-3.10.0-98.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.