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

Side by Side Diff: sandbox/win/src/win_utils.cc

Issue 150093006: Include trailing '\' when iterating over path in reparse points search. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added period to the end of comment. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sandbox/win/src/win_utils.h" 5 #include "sandbox/win/src/win_utils.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "sandbox/win/src/internal_types.h" 10 #include "sandbox/win/src/internal_types.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 NOTREACHED_NT(); 107 NOTREACHED_NT();
108 return error; 108 return error;
109 } 109 }
110 } else if (FILE_ATTRIBUTE_REPARSE_POINT & attributes) { 110 } else if (FILE_ATTRIBUTE_REPARSE_POINT & attributes) {
111 // This is a reparse point. 111 // This is a reparse point.
112 *result = true; 112 *result = true;
113 return ERROR_SUCCESS; 113 return ERROR_SUCCESS;
114 } 114 }
115 115
116 last_pos = path.rfind(L'\\'); 116 last_pos = path.rfind(L'\\');
117 } while (last_pos != base::string16::npos); 117 } while (last_pos > 2); // Skip root dir.
118 118
119 *result = false; 119 *result = false;
120 return ERROR_SUCCESS; 120 return ERROR_SUCCESS;
121 } 121 }
122 122
123 // We get a |full_path| of the form \??\c:\some\foo\bar, and the name that 123 // We get a |full_path| of the form \??\c:\some\foo\bar, and the name that
124 // we'll get from |handle| will be \device\harddiskvolume1\some\foo\bar. 124 // we'll get from |handle| will be \device\harddiskvolume1\some\foo\bar.
125 bool SameObject(HANDLE handle, const wchar_t* full_path) { 125 bool SameObject(HANDLE handle, const wchar_t* full_path) {
126 base::string16 path(full_path); 126 base::string16 path(full_path);
127 DCHECK_NT(!path.empty()); 127 DCHECK_NT(!path.empty());
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 for (int tries = 1; !(*function_ptr) && tries < max_tries; ++tries) { 316 for (int tries = 1; !(*function_ptr) && tries < max_tries; ++tries) {
317 if (tries >= sleep_threshold) 317 if (tries >= sleep_threshold)
318 ::Sleep(1); 318 ::Sleep(1);
319 ntdll = ::GetModuleHandle(sandbox::kNtdllName); 319 ntdll = ::GetModuleHandle(sandbox::kNtdllName);
320 *function_ptr = ::GetProcAddress(ntdll, name); 320 *function_ptr = ::GetProcAddress(ntdll, name);
321 } 321 }
322 322
323 CHECK_NT(*function_ptr); 323 CHECK_NT(*function_ptr);
324 } 324 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698