GNOME Bugzilla – Bug 337820
Complete data loss when editing files in archive
Last modified: 2006-12-17 10:19:10 UTC
Steps to reproduce: 1. Double-click on a .tar.gz file, to open archive window 2. Double-click on a file in the archive window to edit it (This happened with Gnucash 1.8.10, but would probably happen with most apps) 3. Spend three hours entering data in the app, saving regularly. 4. Close the application, close the archive window, reboot the computer 5. Double-click on the archive to open it RESULT: All data entries and changes are gone and unrecoverable Stack trace: Other information: SUGGESTION: The /tmp directories and files used by file roller to create the archive window should all be READ-ONLY to prevent applications and users from making changes that will be lost without warning.
Man, that sucks... Very sorry to hear about your data loss Yes, a possible way of solving this would be to make the _files_ edited from an archive read-only. Wonder why this hasn't been done yet... As for making /tmp read-only: the whole point of /tmp is that it should be easily readable and writeable, and that the files there can be erased at any point... But yeah - a file shouldn't be editable if just saving it leads to it not being added back to the archive...
Created attachment 63237 [details] [review] proposed patch Does chmod to make the files read-only
Created attachment 63265 [details] [review] proposed patch 2 Sorry, the last patch was not made with the -u -p parameters. Now it's better readable.
Thanks so much for working on this! By the way, I think it might be important to write-protect the /tmp/tmp-XXXXY directory too. Some applications write auxilary files to the same directory as the opened file is in (e.g. GnuCash log files). This data shouldn't disappear unexpectedly either. Thanks!!
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 109767 ***