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

Issue 10690047: Fix a bug in file_util::Delete() where symlinks are not handled right (Closed)

Created:
8 years, 5 months ago by yoshiki
Modified:
8 years, 5 months ago
Reviewers:
brettw, satorux1
CC:
chromium-reviews, erikwright (departed), brettw-cc_chromium.org
Visibility:
Public.

Description

Fix a bug in file_util::Delete() where symlinks are not handled right With this patch, file_util::Delete() uses lstat64() instead of stat64(), so that Delete() checks the existence of the symbolic link itself not a file pointed by the symlink. This allows us to delete a symbolic link when it points to a non-existent file. BUG=119430 TEST=base_unittests::FileUtilTest.* passes. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=145060

Patch Set 1 #

Patch Set 2 : . #

Total comments: 11

Patch Set 3 : Review fix #

Patch Set 4 : Sync & add comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -3 lines) Patch
M base/file_util.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M base/file_util_posix.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M base/file_util_unittest.cc View 1 2 1 chunk +42 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
yoshiki
8 years, 5 months ago (2012-06-29 17:47:28 UTC) #1
satorux1
http://codereview.chromium.org/10690047/diff/3001/base/file_util_posix.cc File base/file_util_posix.cc (right): http://codereview.chromium.org/10690047/diff/3001/base/file_util_posix.cc#newcode210 base/file_util_posix.cc:210: int test_link = CallLstat(path_str, &file_info); test_link -> test. lstat() ...
8 years, 5 months ago (2012-06-29 18:25:20 UTC) #2
satorux1
BTW, i'm not a base owner. please add brettw or willchan once you address my ...
8 years, 5 months ago (2012-06-29 18:26:13 UTC) #3
yoshiki
brettw: Could you take a look and approve to check-in? http://codereview.chromium.org/10690047/diff/3001/base/file_util_posix.cc File base/file_util_posix.cc (right): http://codereview.chromium.org/10690047/diff/3001/base/file_util_posix.cc#newcode210 ...
8 years, 5 months ago (2012-06-29 19:12:27 UTC) #4
brettw
Can you add a comment to Delete in file_util.h mentioning how symbolic links are handled ...
8 years, 5 months ago (2012-06-29 19:15:33 UTC) #5
yoshiki
brettw: Thanks, I added the comment. This patch will be in the CQ shortly.
8 years, 5 months ago (2012-06-30 04:09:08 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoshiki@chromium.org/10690047/12001
8 years, 5 months ago (2012-06-30 04:09:22 UTC) #7
commit-bot: I haz the power
8 years, 5 months ago (2012-06-30 05:27:01 UTC) #8
Change committed as 145060

Powered by Google App Engine
This is Rietveld 408576698