Ethereal-dev: Re: [Ethereal-dev] File overwriting still possible (preliminary patch)

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Richard Sharpe <rsharpe@xxxxxxxxxx>
Date: Thu, 18 Jul 2002 02:11:23 +0930 (CST)
On Wed, 17 Jul 2002, Joerg Mayer wrote:

> The problem with file.c still persists when I enter the filename from
> the command line and then "save to" via the gui. This is caused by the
> file requester always returning an absolute path. I've created a very
> preliminary patch that resolves this. I don't know whether this has any
> chance of working with Windows too, or if I should put a #ifdef Unix
> around the new code. Please let me know how to improve this patch. I'm
> also planning to handle the error case differently: Create a temporary
> file, write to that and after that unlink the old one and rename the
> temp file.  As this replaces Ethereal's input file, I guess I have to
> take care of that. Is this more than closing and reopening the file?

OK, the problem was that I did not test thoroughly. I did something like 
ethereal -n -r ~/some path ... :-(

Regards
-----
Richard Sharpe, rsharpe@xxxxxxxxxx, rsharpe@xxxxxxxxx, 
sharpe@xxxxxxxxxxxx