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

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

Issue 432543005: Replace NT prefix in sandbox rules match string to handle correct wildcard escaping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed bug number from comment Created 6 years, 4 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 <string> 5 #include <string>
6 6
7 #include "sandbox/win/src/filesystem_policy.h" 7 #include "sandbox/win/src/filesystem_policy.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/win/scoped_handle.h" 10 #include "base/win/scoped_handle.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 const wchar_t kNTPrefixEscaped[] = L"\\/?/?\\"; 387 const wchar_t kNTPrefixEscaped[] = L"\\/?/?\\";
388 const int kNTPrefixEscapedLen = arraysize(kNTPrefixEscaped) - 1; 388 const int kNTPrefixEscapedLen = arraysize(kNTPrefixEscaped) - 1;
389 389
390 if (0 != mod_name.compare(0, kNTPrefixLen, kNTPrefix)) { 390 if (0 != mod_name.compare(0, kNTPrefixLen, kNTPrefix)) {
391 if (0 != mod_name.compare(0, kNTPrefixEscapedLen, kNTPrefixEscaped)) { 391 if (0 != mod_name.compare(0, kNTPrefixEscapedLen, kNTPrefixEscaped)) {
392 // TODO(nsylvain): Find a better way to do name resolution. Right now we 392 // TODO(nsylvain): Find a better way to do name resolution. Right now we
393 // take the name and we expand it. 393 // take the name and we expand it.
394 mod_name.insert(0, kNTPrefixEscaped); 394 mod_name.insert(0, kNTPrefixEscaped);
395 } 395 }
396 } else { 396 } else {
397 // Start of name matches NT prefix, replace with escaped format 397 // Start of name matches NT prefix, replace with escaped format
rvargas (doing something else) 2014/08/25 23:10:11 nit: end with period.
398 // Fixes bug: 334882
399 mod_name.replace(0, kNTPrefixLen, kNTPrefixEscaped); 398 mod_name.replace(0, kNTPrefixLen, kNTPrefixEscaped);
400 } 399 }
401 400
402 return mod_name; 401 return mod_name;
403 } 402 }
404 403
405 } // namespace sandbox 404 } // namespace sandbox
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