Re: BUG #4116: Cannot create tablespace: could not set permissions on directory

From: Graham Leggett <minfrin(at)sharp(dot)fm>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4116: Cannot create tablespace: could not set permissions on directory
Date: 2008-06-19 12:43:20
Message-ID: 485A5468.8040800@sharp.fm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:

>>> This code makes the incorrect assumption that the platform will allow the
>>> postgres user to set the permissions using chmod.
>
>> Is this something we should do anything about?
>
> IMHO, no. The reason for actually doing the chmod is to verify that we
> own the directory. If it fails, we don't own the directory in any
> meaningful sense. I think the complainant's real problem is that he's
> misconfigured his SELinux permissions.

I'm afraid the machine came with SELinux permissions pre-misconfigured
for me, and postgres didn't help the situation at all by sending me on a
wild goose chase.

The correct way to check the permissions are correct is by testing the
current permission values against what they should be, and then failing
clearly and explicitly with a meaningful error message. Right now the
code takes a short cut, which is easy for the coder, but very painful
for the long suffering administrator.

Regards,
Graham
--

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-06-19 14:10:52 Re: BUG advisory_lock
Previous Message Eugen.Konkov 2008-06-19 09:59:37 BUG advisory_lock