Bug 732228 - postgresql initdb problems with unconfined disabled
Summary: postgresql initdb problems with unconfined disabled
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 15
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-08-21 04:52 UTC by Robin Powell
Modified: 2011-10-06 00:03 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.9.16-39.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-10-06 00:03:05 UTC

Attachments (Terms of Use)

Description Robin Powell 2011-08-21 04:52:35 UTC
Running "sudo /etc/init.d/postgresql initdb" gives this:

type=AVC msg=audit(1313902281.411:164863): avc:  denied  { create } for  pid=28395 comm="mkdir" name="pg_log" scontext=staff_u:system_r:initrc_t:s0 tcontext=staff_u:object_r:postgresql_db_t:s0 tclass=dir
type=AVC msg=audit(1313902281.424:164865): avc:  denied  { setattr } for  pid=28396 comm="chown" name="pg_log" dev=vda2 ino=153795 scontext=staff_u:system_r:initrc_t:s0 tcontext=staff_u:object_r:postgresql_db_t:s0 tclass=dir


Comment 1 Miroslav Grepl 2011-08-22 12:22:25 UTC
Could you add me your output of

grep mkdir /etc/init.d/postgresql

Comment 2 Daniel Walsh 2011-08-22 16:09:44 UTC
Lets just change postgresql_manage_db to the following.

		type postgresql_db_t;

	manage_dirs_pattern($1, postgresql_db_t, postgresql_db_t)
	manage_files_pattern($1, postgresql_db_t, postgresql_db_t)
	manage_lnk_files_pattern($1, postgresql_db_t, postgresql_db_t)

Comment 3 Daniel Walsh 2011-08-22 16:11:47 UTC
I checked this change into F16, should be back ported to RHEL6.

Comment 4 Robin Powell 2011-08-22 16:37:39 UTC
I suppose it doesn't matter anymore, but since you asked:

rlpowell@morji> sudo grep mkdir /etc/init.d/postgresql                                                                        
                mkdir -p "$PGDATA" || return 1
        mkdir "$PGDATA/pg_log"


Comment 5 Miroslav Grepl 2011-08-24 06:16:50 UTC
thanks. I will add a patch from F16 which Dan added.

Comment 6 Fedora Update System 2011-09-08 08:12:36 UTC
selinux-policy-3.9.16-39.fc15 has been submitted as an update for Fedora 15.

Comment 7 Fedora Update System 2011-09-09 05:28:42 UTC
Package selinux-policy-3.9.16-39.fc15:
* should fix your issue,
* was pushed to the Fedora 15 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.9.16-39.fc15'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2011-10-06 00:03:05 UTC
selinux-policy-3.9.16-39.fc15 has been pushed to the Fedora 15 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.