Bug 812478
Summary: | SELinux is preventing /usr/bin/initdb from 'append' accesses on the file /var/lib/pgsql/initdb.log. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Luke Macken <lmacken> |
Component: | postgresql | Assignee: | Pavel Raiskup <praiskup> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 17 | CC: | devrim, dominick.grift, dwalsh, hhorak, mgrepl, pfrields, tgl |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Unspecified | ||
Whiteboard: | abrt_hash:7290333fa07401a1ad7d1e4eac32463b5fbedea5939531fb653a26f96d9d86d8 | ||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-06-04 11:35:15 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
Luke Macken
2012-04-13 20:38:31 UTC
type=AVC msg=audit(1334349463.375:966): avc: denied { getattr } for pid=24722 comm="initdb" path="/var/lib/pgsql/initdb.log" dev="dm-2" ino=5123635 scontext=unconfined_u:system_r:postgresql_t:s0 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file Why isn't this file in /var/log/pgsql/ We don't use /var/log/pgsql/, for anything. This location of the initdb log file has been in use for a long time, why did it suddenly break? Here is the labeling we have had for postgress for a long time. Did initdb.log used to be in the /var/lib/pgsql/logfile? Should we label /var/lib/pgsql as postgresql_db_t? /var/lib/postgres(ql)?(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0) /var/lib/pgsql/data(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0) /var/lib/pgsql/logfile(/.*)? gen_context(system_u:object_r:postgresql_log_t,s0) /var/lib/pgsql/pgstartup\.log gen_context(system_u:object_r:postgresql_log_t,s0) /var/lib/sepgsql(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0) /var/lib/sepgsql/pgstartup\.log -- gen_context(system_u:object_r:postgresql_log_t,s0) /var/log/postgres\.log.* -- gen_context(system_u:object_r:postgresql_log_t,s0) /var/log/postgresql(/.*)? gen_context(system_u:object_r:postgresql_log_t,s0) /var/log/sepostgresql\.log.* -- gen_context(system_u:object_r:postgresql_log_t,s0) ifdef(`distro_redhat', ` /var/log/rhdb/rhdb(/.*)? gen_context(system_u:object_r:postgresql_log_t,s0) ') /var/run/postgresql(/.*)? gen_context(system_u:object_r:postgresql_var_run_t,s0) Changed labeling in selinux-policy-3.10.0-117.fc17 Hm, I wonder how this ever worked? /var/lib/pgsql/ has been the place for a very long time; AFAIK the RPMs have been using that as the standard data directory location for ten years or so. We have never used /var/lib/postgres or /var/lib/postgresql. I don't believe we have ever put anything into /var/log/ at all. I would suggest labeling /var/lib/pgsql/.*.log as well as /var/lib/pgsql/data/pg_log/.* as postgresql_log_t. I have no objection to continuing to label the other directories as you have them, since it's possible people are relying on those for custom setups. But it might be a good idea to add comments about which ones are standard and which not. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. Following hunk in policy-rawhide-base.patch fixes the issue. No need to keep this open then, I guess. @@ -28,9 +28,9 @@ ifdef(`distro_redhat', ` # /var/lib/postgres(ql)?(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0) -/var/lib/pgsql/data(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0) +/var/lib/pgsql(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0) /var/lib/pgsql/logfile(/.*)? gen_context(system_u:object_r:postgresql_log_t,s0) -/var/lib/pgsql/pgstartup\.log gen_context(system_u:object_r:postgresql_log_t,s0) +/var/lib/pgsql/.*\.log gen_context(system_u:object_r:postgresql_log_t,s0) /var/lib/sepgsql(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0) /var/lib/sepgsql/pgstartup\.log -- gen_context(system_u:object_r:postgresql_log_t,s0) |