After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687344 - Temp file used by g_file_replace is leaked if the operation fails or is cancelled
Temp file used by g_file_replace is leaked if the operation fails or is cance...
Status: RESOLVED DUPLICATE of bug 629301
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-11-01 14:44 UTC by Carlos Garcia Campos
Modified: 2012-11-02 12:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (982 bytes, patch)
2012-11-01 14:44 UTC, Carlos Garcia Campos
none Details | Review

Description Carlos Garcia Campos 2012-11-01 14:44:13 UTC
Created attachment 227804 [details] [review]
Patch

I've noticed that I have a lot of .goutputstream- files in a directory where a file is replaced. The problem is that when replace is cancelled before the rename, the temp file is no deleted.
Comment 1 Dan Winship 2012-11-02 12:31:46 UTC
> Call g_unlink on the temp file when the output stream close finishes due
> to an error or it's cancelled. If it was cancelled after the rename, the
> temp file won't exist and g_unlink will fail silently.

That's a tiny bit unsafe... theoretically, another GFile op could have ended up getting the same file name after the first temp file was renamed...

also, dup

*** This bug has been marked as a duplicate of bug 629301 ***