New issue
Advanced search Search tips

Issue 691388 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug-Regression



Sign in to add a comment

ImportantFileWriter.FailedWriteWithObserver leaks a *.tmp file in current working directory

Project Member Reported by w...@chromium.org, Feb 12 2017

Issue description

Chrome Version: 58.0.3010.0
OS: Windows

What steps will reproduce the problem?
(1) Run base_unittests.
(2) Run "dir *.tmp"

What is the expected result?

Expect that no files are found.

What happens instead?

There is a .tmp file created by each run of base_unittests.

 

Comment 1 by w...@chromium.org, Feb 17 2017

Owner: proberge@chromium.org
Status: Assigned (was: Untriaged)
Summary: ImportantFileWriter.FailedWriteWithObserver leaks a *.tmp file in current working directory (was: Something in base_unittests leaks a *.tmp file in )
For the record, what was the culprit CL that introduced this problem?
Project Member

Comment 4 by bugdroid1@chromium.org, Feb 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/05db50c5c72b8368af872b768cb637c294e99f44

commit 05db50c5c72b8368af872b768cb637c294e99f44
Author: proberge <proberge@chromium.org>
Date: Wed Feb 22 23:24:01 2017

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}

[modify] https://crrev.com/05db50c5c72b8368af872b768cb637c294e99f44/base/files/important_file_writer.cc

Thanks for finding this issue @wez, I'm sure all Windows developers will appreciate not getting temp files in their git status :)
Status: Fixed (was: Assigned)

Sign in to add a comment