Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 236546 - postgresql-server-8.3: incorrect permissions on /var/run/postgresql
Summary: postgresql-server-8.3: incorrect permissions on /var/run/postgresql
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-03 09:27 UTC by Marti Raudsepp
Modified: 2010-06-18 04:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marti Raudsepp 2008-09-03 09:27:31 UTC
In the new and recent postgresql-server-8.3.3 ebuild, the daemon is configured to listen on the local socket in /var/run/postgresql.s.PGSQL.5432 . However, this directory is set to permissions 0770, in the ebuild:
    keepdir /var/run/postgresql
    fperms 0770 /var/run/postgresql

Obviously, what this means, is that no ordinary user is permitted to connect to PostgreSQL:

% psql
psql: could not connect to server: Permission denied
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

The fix is to change the /var/run/postgresql directory mode to 0771 or greater.

(Seriously, am I the first to actually try installing this ebuild? ;)


Reproducible: Always

Steps to Reproduce:
1. install postgresql-server-8.3.3
2. Create the database and run /etc/init.d/postgresql-8.3 start
3. run 'psql' as an ordinary user
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-09-03 14:17:07 UTC
I assume you mean dev-db/postgresql-server? Just postgresql-server is ambiguous.
Comment 2 Tiziano Müller (RETIRED) gentoo-dev 2008-09-03 17:20:51 UTC
But obviously the first who didn't read the messages spit out by the ebuild:

"Please note that the standard location of the socket has changed from /tmp"
"to /var/run/postgresql and you have to be in the 'postgres' group to access"
"the socket."
"This can break applications which have the standard location hard-coded."
"If such an application links against the libpq, please re-emerge it,"
"if that doesn't help or the application accesses the socket without using libpq,"
"please file a bug-report."
"You can set PGOPTS='-k /tmp' in /etc/conf.d/postgresql-${SLOT} to restore the original location."
Comment 3 Joseph 2010-06-18 04:14:44 UTC
I did added myself to group "postgres" re-log IN but still couldn't access the socket.
However, changing permission to:
/var/run/postgresql directory mode to 0771

solved the problem.
So what is the point being in group "postgres" since it doesn't work.