Re: Don't allow relative path for copy from file

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Etsuro Fujita" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: "'PostgreSQL-development'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Don't allow relative path for copy from file
Date: 2012-08-15 14:05:54
Message-ID: 2761.1345039554@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Etsuro Fujita" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> writes:
> As described in the reference manual for COPY, we should to check file's path
> format not to allow relative path. Please find attached a patch.

The argument for disallowing writing to a relative path is to make it
harder to accidentally overwrite a database file. That argument does
not apply to COPY IN, so I'm not convinced we should impose an
additional restriction. It's not out of the question that this would
break real-world use-cases --- imagine someone whose workflow involves
copying data files across a network to a directory accessible to the
server (and quite possibly specified by a relative path) and then doing
COPY IN.

In any case, this patch is missing documentation updates, specifically
the paragraph in the COPY reference page that it falsifies.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2012-08-15 15:22:05 Re: sha1, sha2 functions into core?
Previous Message Tom Lane 2012-08-15 13:48:43 Re: sha1, sha2 functions into core?