pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tauren Mills <tauren@servlets.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-admin@postgresql.org
Subject: RE: Alternate database locations
Date: Mon, 4 Jun 2001 13:27:04 -0700
Message-ID: <NBBBLBKDJMGDNPMDGAABEEMFADAB.tauren@servlets.net> (raw)
In-Reply-To: <29453.991664104@sss.pgh.pa.us>

Thanks for the feedback!

> >> However, this page indicates that there are security risks in
> doing this.
> >> What are those risks?  If I prevent users other than the superuser
> >> "postgres" from being able to create and drop databases, are there any
> >> security risks?
>
> > No.  The risks are related to the fact that non-superusers can also be
> > allowed to create databases.
>
> If the user's DB area is in his home directory, then he can presumably
> rename it, leading to nasty problems when operations like CHECKPOINT try
> to write to files in it.  At the very least you'd have potential for
> denial of service to all the other users.

OK, this makes sense.  In the user's home directory, I was going to create a
directory called something like ".db".  It would be owned by postgres:root
and have 700 permissions.  Within it, would be the "base" directory as
postgres:postgres and 700.

This is very similar to the way that we deploy MySQL.  But this does still
allow the user to change the directory name.  With MySQL, it would just
cause their database to not work, it wouldn't cause problems with the
server.  It sounds like this is not a good idea with PostgreSQL.

Is there any way to keep each customer's database within their user area
without the chance of breaking the database server?

> >> Lastly, I've even tried creating a database normally, then
> moving it to the
> >> user's area and creating a symlink to it.  But this didn't
> seem to work.
>
> > It should, since that is what the "official" mechanisms do as well.
>
> Yes, I'd have thought that would work.  Define "didn't seem to work",
> please.

Based on what you said, I went back and tried it again.  It "seems to work"
correctly now.  I think I must not have had the proper permissions set the
first time I tried it.

Even though this is exactly the solution I was looking for, I'm now
reluctant to use it since a user could break things by simply changing a
directory name.  I guess I'll have to keep the databases separate from the
user's home area.

Thanks,
Tauren




view thread (11+ messages)  latest in thread

Message-ID: <NBBBLBKDJMGDNPMDGAABEEMFADAB.tauren@servlets.net>
Permalink:  ../NBBBLBKDJMGDNPMDGAABEEMFADAB.tauren@servlets.net/
Also on:    postgresql.org/message-id/NBBBLBKDJMGDNPMDGAABEEMFADAB.tauren@servlets.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tauren@servlets.net, tgl@sss.pgh.pa.us, peter_e@gmx.net
  Subject: Re: Alternate database locations
  In-Reply-To: <NBBBLBKDJMGDNPMDGAABEEMFADAB.tauren@servlets.net>
  References: <29453.991664104@sss.pgh.pa.us> <NBBBLBKDJMGDNPMDGAABEEMFADAB.tauren@servlets.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox