Re: [BUGS] BUG #1830: Non-super-user must be able to copy from a file

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bernard <bht(at)actrix(dot)gen(dot)nz>
Cc: andrew(at)supernews(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: [BUGS] BUG #1830: Non-super-user must be able to copy from a file
Date: 2005-08-19 08:55:48
Message-ID: 20050819085544.GA6226@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

On Fri, Aug 19, 2005 at 05:49:06PM +1200, Bernard wrote:
> If the owner of an application owning the connections trusts the
> application and gets the postgres superuser to grant it the right to
> read from files, then it is obviously acceptable to the owner of the
> application and to the postgres superuser. There is no doubt about
> that and the owner of the application is not concerned with 3rd party
> acceptability. This would be a solution even if Postgres system files
> were totally exposed. Better than nothing.

I think what people are trying to tell you is that "permission to read
server files" == "superuser". If the postgres superuser grants you
permission to read server files, they then have access to all files in
all databases in the server, i.e. they are superuser. You know, read
passwords, see ident mappings, etc...

So in your case, what's the problem with making your user a superuser,
it's not like you're limited to just one.

Finally, as someone pointed out, you can create a function to execute
the copy as a superuser and let your normal user call it.

No need to open up the whole system just to solve something that a five
line function will do just as well.
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Sean Utt 2005-08-19 09:19:20 Re: BUG #1830: Non-super-user must be able to copy from a file
Previous Message Sean Utt 2005-08-19 08:10:46 Re: [GENERAL] BUG #1830: Non-super-user must be able to copy from a

Browse pgsql-general by date

  From Date Subject
Next Message Surabhi Ahuja 2005-08-19 09:05:58 threads and transaction ...sample code and stored procedure
Previous Message Len Walter 2005-08-19 08:34:03 Re: Timing out connections?