Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Issue 2711523002: Fix ImportantFileWriter leaking a .tmp file when passed an invalid path (Closed)

Created:
3 years, 10 months ago by proberge
Modified:
3 years, 10 months ago
Reviewers:
dcheng
CC:
chromium-reviews, tfarina, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix ImportantFileWriter leaking a .tmp file when passed an invalid path When passed an invalid path (ex. "bad/../path"), ImportantFileWriter creates a temp file, sees that it's invalid, then returns without deleting it. The file being invalid is an implementation detail of base::File's Initialize() method, which sets an error field to FILE_ERROR_ACCESS_DENIED if the file's path contains the parent ".." operator. This stops ImportantFileWriterTest.FailedWriteWithObserver from leaking a temp file. BUG=691388 Review-Url: https://codereview.chromium.org/2711523002 Cr-Commit-Position: refs/heads/master@{#452266} Committed: https://chromium.googlesource.com/chromium/src/+/05db50c5c72b8368af872b768cb637c294e99f44

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -0 lines) Patch
M base/files/important_file_writer.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 13 (7 generated)
proberge
3 years, 10 months ago (2017-02-21 16:17:12 UTC) #3
dcheng
Dumb question: how do we end up with a temporary file that we can't open ...
3 years, 10 months ago (2017-02-21 23:52:41 UTC) #4
proberge
On 2017/02/21 23:52:41, dcheng wrote: > Dumb question: how do we end up with a ...
3 years, 10 months ago (2017-02-22 14:12:37 UTC) #5
dcheng
On 2017/02/22 14:12:37, proberge wrote: > On 2017/02/21 23:52:41, dcheng wrote: > > Dumb question: ...
3 years, 10 months ago (2017-02-22 18:07:35 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2711523002/1
3 years, 10 months ago (2017-02-22 21:07:38 UTC) #10
commit-bot: I haz the power
3 years, 10 months ago (2017-02-22 23:25:07 UTC) #13
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/05db50c5c72b8368af872b768cb6...

Powered by Google App Engine
This is Rietveld 408576698