Bug 115278

Summary: default permissions in postgresql-server-7.3.4-3.rhl9 break krb5 authentication
Product: [Retired] Red Hat Linux Reporter: Nalin Dahyabhai <nalin>
Component: postgresqlAssignee: Tom Lane <tgl>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-12 04:52:56 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 Nalin Dahyabhai 2004-02-10 00:28:58 UTC
Description of problem:
The default permissions on /etc/sysconfig/pgsql prevent krb5
authentication from working.

Version-Release number of selected component (if applicable):
7.3.4-3.rhl9

How reproducible:
Always.

Steps to Reproduce:
1. Configure a user to require "krb5" authentication in pg_hba.conf 
2. Extract the database key into a keytab in the default location
(/etc/sysconfig/pgsql/krb5.keytab).
3. Make the keytab readable by postgresql (chgrp postgres
/etc/sysconfig/pgsql/krb5.keytab; chmod g+r
/etc/sysconfig/pgsql/krb5.keytab).
4. Restart postgresql just in case.
5. Attempt to connect as the user (psql -h hostname -l).
  
Actual results:
User will get a "Kerberos 5 authentication failed" error, and the
server will log an error 13 (EACCES) in /var/log/messages.

Expected results:
Authentication should succeed, user does the dance of joy.

Additional info:
A workaround is to make /etc/sysconfig/pgsql 0750, group postgres, but
I don't know of any other implications to making this change.

Comment 1 Tom Lane 2004-03-05 17:37:52 UTC
More than that: Postgres also expects pg_service.conf to be in the
--sysconfdir directory, so we'd have to make the directory
world-readable if we want to use it as --sysconfdir.

I cannot see any good reason offhand why it's not world-readable;
other subdirectories of /etc/sysconfig are.

Comment 2 Tom Lane 2004-03-05 22:54:56 UTC
A fix slated for RHEL3 Update 2 is now in QA.

Comment 3 Tom Lane 2004-03-10 22:12:45 UTC
A (slightly different) fix is also in Postgres 7.4.2 RPMs btw, both
Fedora Core 2 and the PGDG RPM sets.

Comment 4 John Flanagan 2004-05-12 04:52:56 UTC
An errata 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 the 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-2004-116.html