Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Bugs > BUG #4116: Cann...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3717 of 3904
Post > Topic >>

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

by minfrin@[EMAIL PROTECTED] ("Graham Leggett") Apr 19, 2008 at 12:38 PM

The following bug has been logged online:

Bug reference:      4116
Logged by:          Graham Leggett
Email address:      minfrin@[EMAIL PROTECTED]
 version: 8.1.11
Operating system:   Redhat Enterprise 5
Description:        Cannot create tablespace: could not set permissions on
directory
Details: 

While making an attempt to create a tablespace, where the tablespace
directory has already been created, has the correct owner****p, and has the
correct permissions (0700), the attempt will fail regardless:

postgres=# CREATE TABLESPACE fma LOCATION '/home/fma/db/pgsql';
ERROR:  could not set permissions on directory "/home/fma/db/pgsql":
Permission denied

Looking in the source, the error message "could not set permissions on
directory" appears here:

01283         /*
01284          * Attempt to coerce target directory to safe permissions. 
If
this
01285          * fails, it doesn't exist or has the wrong owner.
01286          */
01287         if (chmod(location, 0700) != 0)
01288             ere****t(ERROR,
01289                     (errcode_for_file_access(),
01290                   errmsg("could not set permissions on directory
\"%s\": %m",
01291                          location)));

This code makes the incorrect assumption that the platform will allow the
postgres user to set the permissions using chmod.

What this code should be doing is checking that the permissions on the
directory are 0700, and failing if they are not, leaving it up to the user
to fix the problem.

Redhat Enterprise Linux 5 refuses to allow a user to chmod a directory,
even
though that user owns that directory. In addition, if SELinux is enabled,
this gives a further reason why the code will fail.

To fix this, check that the mode is 0700, don't try to set it.

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
 




 3 Posts in Topic:
BUG #4116: Cannot create tablespace: could not set permissions o
minfrin@[EMAIL PROTECTED]  2008-04-19 12:38:41 
Re: BUG #4116: Cannot create tablespace: could not set
alvherre@[EMAIL PROTECTED  2008-06-06 17:42:47 
Re: BUG #4116: Cannot create tablespace: could not set permissio
tgl@[EMAIL PROTECTED] (T  2008-06-06 19:52:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Tue Jul 8 23:07:21 CDT 2008.