! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Incorrect "file exists" test when creating archive
Status:
RESOLVED: WONTFIX
Product:
Squeeze
Component:
squeeze

Comments

Description Jerome 2012-03-12 16:18:35 CET
When creating an archive, the test for "file name exists" is done before the extension is appended to the file name, making it kind of useless.

How to reproduce :

Create dummy file "test"
Right-click "Create archive"

Enter "test" as an archive name and choose format.

Squeeze will complain text already exists. Ignore, and test.zip (for instance) will be created. No damage.

Worse :

touch ./test_folder/test.zip

Right-click "Create archive" on ./test

Enter "test" as an archive name, choose format, and save in ./test_folder. Squeeze silently erases ./test_folder/test.zip. Dangerous.

Squeeze version 0.2.3
Comment 1 Jerome 2012-03-18 23:18:52 CET
I'm not sure anything can be done about it if we stick to the file chooser dialog overwrite confirmation feature :

new_dialog.c :

	dialog = g_object_new(sq_new_archive_dialog_get_type(),
			"title", _("Create new archive"),
			"do-overwrite-confirmation", TRUE,        <--- here
			"action", GTK_FILE_CHOOSER_ACTION_SAVE,
			NULL);

The "file already exists" test should be done in the code after the dialog returns and the extension is added.

As a comparison, I had a look at xarchiver. 

The version of xarchiver that can be found here has the same issue :
http://sourceforge.net/scm/?type=svn&group_id=140153

In fact, you can see in new_dialog.c :
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (xa_file_chooser), TRUE);

IMHO, this is a regression introduced here, when the "file exists" test was removed from the code to use the GTK file chooser overwrite confirmation feature :
http://xarchiver.svn.sourceforge.net/viewvc/xarchiver/trunk/src/new_dialog.c?r1=20&r2=21&pathrev=21&
(search for "overwrite")

However, latest version of xarchiver here does not have this bug :
http://git.xfce.org/archive/xarchiver/tree/src/new_dialog.c
Comment 2 Skunnyk editbugs 2019-08-18 22:40:02 CEST
squeeze is not maintained anymore, closing.

Bug #8564

Reported by:
Jerome
Reported on: 2012-03-12
Last modified on: 2019-08-18

People

Assignee:
Stephan Arts
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information