| OLD | NEW |
| 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 Loading... |
| 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. |
| 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 |
| OLD | NEW |