Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "remoting/host/setup/me2me_native_messaging_host.h" | 5 #include "remoting/host/setup/me2me_native_messaging_host.h" |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 559 // presubmit: allow wstring | 559 // presubmit: allow wstring |
| 560 std::wstring user_sid; | 560 std::wstring user_sid; |
| 561 if (!base::win::GetUserSidString(&user_sid)) { | 561 if (!base::win::GetUserSidString(&user_sid)) { |
| 562 LOG(ERROR) << "Failed to query the current user SID."; | 562 LOG(ERROR) << "Failed to query the current user SID."; |
| 563 OnError(); | 563 OnError(); |
| 564 return; | 564 return; |
| 565 } | 565 } |
| 566 | 566 |
| 567 // Create a security descriptor that gives full access to the caller and | 567 // Create a security descriptor that gives full access to the caller and |
| 568 // denies access by anyone else. | 568 // denies access by anyone else. |
| 569 std::string security_descriptor = base::StringPrintf( | 569 std::string user_sid_utf16 = base::WideToUTF8(user_sid); |
|
Sergey Ulanov
2015/02/05 20:39:12
I think this should be user_sid_utf8
Nico
2015/02/05 20:41:30
You mean _ascii, and the rhs should be UTF16ToASCI
Nico
2015/02/05 21:58:44
Done.
| |
| 570 "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", base::UTF16ToASCII(user_sid).c_str()); | 570 std::string security_descriptor = |
| 571 base::StringPrintf("O:%sG:%sD:(A;;GA;;;%s)", user_sid_utf16.c_str(), | |
| 572 user_sid_utf16.c_str(), user_sid_utf16.c_str()); | |
| 571 | 573 |
| 572 ScopedSd sd = ConvertSddlToSd(security_descriptor); | 574 ScopedSd sd = ConvertSddlToSd(security_descriptor); |
| 573 if (!sd) { | 575 if (!sd) { |
| 574 PLOG(ERROR) << "Failed to create a security descriptor for the" | 576 PLOG(ERROR) << "Failed to create a security descriptor for the" |
| 575 << "Chromoting Me2Me native messaging host."; | 577 << "Chromoting Me2Me native messaging host."; |
| 576 OnError(); | 578 OnError(); |
| 577 return; | 579 return; |
| 578 } | 580 } |
| 579 | 581 |
| 580 SECURITY_ATTRIBUTES security_attributes = {0}; | 582 SECURITY_ATTRIBUTES security_attributes = {0}; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 713 | 715 |
| 714 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( | 716 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( |
| 715 scoped_ptr<base::DictionaryValue> message) { | 717 scoped_ptr<base::DictionaryValue> message) { |
| 716 NOTREACHED(); | 718 NOTREACHED(); |
| 717 return false; | 719 return false; |
| 718 } | 720 } |
| 719 | 721 |
| 720 #endif // !defined(OS_WIN) | 722 #endif // !defined(OS_WIN) |
| 721 | 723 |
| 722 } // namespace remoting | 724 } // namespace remoting |
| OLD | NEW |