Bug 907235 - SELinux is preventing /usr/bin/postgres from 'create' accesses on the directory pg_log.
Summary: SELinux is preventing /usr/bin/postgres from 'create' accesses on the directo...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:2bf97916433ddb5955896a7c8a8...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-03 22:04 UTC by Niki Guldbrand
Modified: 2013-02-11 04:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-11 04:55:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Niki Guldbrand 2013-02-03 22:04:51 UTC
Description of problem:
Had done a postgres initdb, and this appeared when i tried to start postgres for the first time.

Postgres tried to create it's logging folder (per it's default config after initdb: /var/lib/pgsql/data/pg_log)
which was denied, after creating it manually everything was okay...
SELinux is preventing /usr/bin/postgres from 'create' accesses on the directory pg_log.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that postgres should be allowed create access on the pg_log directory 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:
# grep postgres /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:postgresql_t:s0
Target Context                system_u:object_r:postgresql_log_t:s0
Target Objects                pg_log [ dir ]
Source                        postgres
Source Path                   /usr/bin/postgres
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           postgresql-server-9.2.2-1.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-73.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.4-204.fc18.x86_64 #1 SMP Wed
                              Jan 23 16:44:29 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-02-03 20:13:57 CET
Last Seen                     2013-02-03 20:13:57 CET
Local ID                      df240b59-c427-411d-90fd-ade5d285f432

Raw Audit Messages
type=AVC msg=audit(1359918837.918:830): avc:  denied  { create } for  pid=13841 comm="postgres" name="pg_log" scontext=system_u:system_r:postgresql_t:s0 tcontext=system_u:object_r:postgresql_log_t:s0 tclass=dir


type=SYSCALL msg=audit(1359918837.918:830): arch=x86_64 syscall=mkdir success=no exit=EACCES a0=1ab17a0 a1=1c0 a2=0 a3=7fff69ee8a90 items=0 ppid=1 pid=13841 auid=4294967295 uid=26 gid=26 euid=26 suid=26 fsuid=26 egid=26 sgid=26 fsgid=26 ses=4294967295 tty=(none) comm=postgres exe=/usr/bin/postgres subj=system_u:system_r:postgresql_t:s0 key=(null)

Hash: postgres,postgresql_t,postgresql_log_t,dir,create

audit2allow

#============= postgresql_t ==============
allow postgresql_t postgresql_log_t:dir create;

audit2allow -R

#============= postgresql_t ==============
allow postgresql_t postgresql_log_t:dir create;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.4-204.fc18.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-02-04 11:37:40 UTC
Fixed in selinux-policy-3.11.1-75.fc18.noarch

Comment 2 Fedora Update System 2013-02-05 09:24:20 UTC
selinux-policy-3.11.1-76.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-76.fc18

Comment 3 Fedora Update System 2013-02-08 02:36:50 UTC
Package selinux-policy-3.11.1-76.fc18:
* should fix your issue,
* was pushed to the Fedora 18 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.11.1-76.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-2101/selinux-policy-3.11.1-76.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-02-11 04:55:58 UTC
selinux-policy-3.11.1-76.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


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