Opened 9 months ago

Closed 9 months ago

#20646 closed defect (fixed)

finish_writing_to_file_impl() should remove temporary file if replacing an existing one failed

Reported by: fk Owned by:
Priority: Medium Milestone: Tor: 0.3.0.x-final
Component: Core Tor/Tor Version: Tor: 0.2.9.5-alpha
Severity: Normal Keywords: review-group-12
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Functions like start_writing_to_file() rely on finish_writing_to_file_impl() to remove the temporary
file if replacing an already existing one failed.

Currently this doesn't happen. The attached patch fixes this.

Child Tickets

Attachments (1)

0001-finish_writing_to_file_impl-Remove-temporary-file-if.patch (1.5 KB) - added by fk 9 months ago.
[patch] finish_writing_to_file_impl(): Remove temporary file if replacing the existing one failed

Download all attachments as: .zip

Change History (6)

Changed 9 months ago by fk

[patch] finish_writing_to_file_impl(): Remove temporary file if replacing the existing one failed

comment:1 Changed 9 months ago by dgoulet

Milestone: Tor: 0.3.0.x-final
Status: newneeds_review

comment:2 Changed 9 months ago by nickm

Keywords: review-group-12 added

comment:3 Changed 9 months ago by dgoulet

Status: needs_reviewmerge_ready

This seems logical to me as in the case of not being able to replace a file I guess there is no point at keeping the temporary file around.

lgtm;

comment:4 Changed 9 months ago by dgoulet

See branch bug20646_030_01 with the attached patch and change file.

comment:5 Changed 9 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Merged; thank you!

Note: See TracTickets for help on using tickets.