Commit a26f896b authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Don't cross junction points when deleting old temp dirs.

During startup, the mini_installer attempts to free up disk space left
occupied by previous runs of the installer that may have failed to
perform their own cleanup. Such freeing shouldn't cross junction points
or links or other similar filesystem constructs, since such would not
have been created by a previous run. This CL simply skips over any
directories that have reparse points -- directories created by the
installer should not have any.

BUG=1100280
R=waffles@chromium.org

Change-Id: I20d874db50bd11faeac8e03522d162abcae095b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276207
Commit-Queue: Greg Thompson <grt@chromium.org>
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Auto-Submit: Greg Thompson <grt@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784428}
parent e646ca5c
...@@ -753,7 +753,11 @@ void DeleteDirectoriesWithPrefix(const wchar_t* parent_dir, ...@@ -753,7 +753,11 @@ void DeleteDirectoriesWithPrefix(const wchar_t* parent_dir,
PathString path; PathString path;
do { do {
if (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { // Skip over directories that have reparse points, since these represent
// such things as mounted folders, links, etc, and were therefore not
// created by a previous run of this installer.
if ((find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
!(find_data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
// Use the short name if available to make the most of our buffer. // Use the short name if available to make the most of our buffer.
const wchar_t* name = find_data.cAlternateFileName[0] const wchar_t* name = find_data.cAlternateFileName[0]
? find_data.cAlternateFileName ? find_data.cAlternateFileName
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment