Ethereal-dev: [Ethereal-dev] Saving files overwrites existing files without asking the user, I

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: Mon, 15 Jul 2002 03:02:15 +0930 (CST)
Hi,

While the code to check if the save as name is the same as the capture 
file name still seems to be there, it seems to me that the existing code 
does not protect the user from inadvertantly overwriting an existing file 
with a new capture or filtered set of frames.

It does not seem that the code that renames or copies checks to see if the 
to file already exists, like a good app should.

Secondly, there are multiple paths through the file file.c:save_cap_file 
and the protection against overwriting the open capture file does not 
handle them all. It seems that if we are saving a selection in a different 
format, we are in trouble, or if we are filtering, we are in trouble.
 
The code I put in needs to be hoisted to earlier in the path or 
duplicated.

I can't really look at this until next week some time.

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