On Wed, Jan 06, 2010 at 03:08:03PM +0000, Nicholas Clark wrote:
> On Wed, Jan 06, 2010 at 08:12:39AM -0600, Peter da Silva wrote:
> > On 2010-01-06, at 07:50, Nicholas Clark wrote:
> > >So, mysql has an extension of SELECT, "INTO OUTFILE 'file_name'"
> > >
> > >This is great. Until you use a relative filename for file_name.
> > >(For example, their example).
> > >
> > >At which point *the server* writes the output file into the  
> > >directory that
> > >holds the database itself.
> > 
> > What else do you expect to happen? Of course the server is going to  
> > write the file (whether absolute or relative). I seem to recall  
> > looking at "COPY table TO 'filename'" in PostgreSQL and going  
> > "interesting, but not useful, because the server doesn't have access  
> > to my local system".
> 
> If writing arbitrary files into that directory screws up the proper
> functioning of the database, I'd *expect* it to refuse to do so. Hence,
> given that it treats writing a relative file as writing to that directory,
> and the consequences of writing a file to that directory, I would expect it
> to refuse to write to relative paths.


Is that relative to the database directory, or relative the current
working directory of the server, which just happens to be the database
directory by default?

I remember from a previous live as a Sybase DBA that I let the servers
switch cwd to /tmp to avoid this kind of problems.



Abigail

Reply via email to