| 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 // presubmit: allow wstring | 577 // presubmit: allow wstring |
| 578 std::wstring user_sid; | 578 std::wstring user_sid; |
| 579 if (!base::win::GetUserSidString(&user_sid)) { | 579 if (!base::win::GetUserSidString(&user_sid)) { |
| 580 LOG(ERROR) << "Failed to query the current user SID."; | 580 LOG(ERROR) << "Failed to query the current user SID."; |
| 581 OnError(); | 581 OnError(); |
| 582 return; | 582 return; |
| 583 } | 583 } |
| 584 | 584 |
| 585 // Create a security descriptor that gives full access to the caller and | 585 // Create a security descriptor that gives full access to the caller and |
| 586 // denies access by anyone else. | 586 // denies access by anyone else. |
| 587 std::string security_descriptor = base::StringPrintf( | 587 std::string user_sid_ascii = base::UTF16ToASCII(user_sid); |
| 588 "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", base::UTF16ToASCII(user_sid).c_str()); | 588 std::string security_descriptor = |
| 589 base::StringPrintf("O:%sG:%sD:(A;;GA;;;%s)", user_sid_ascii.c_str(), |
| 590 user_sid_ascii.c_str(), user_sid_ascii.c_str()); |
| 589 | 591 |
| 590 ScopedSd sd = ConvertSddlToSd(security_descriptor); | 592 ScopedSd sd = ConvertSddlToSd(security_descriptor); |
| 591 if (!sd) { | 593 if (!sd) { |
| 592 PLOG(ERROR) << "Failed to create a security descriptor for the" | 594 PLOG(ERROR) << "Failed to create a security descriptor for the" |
| 593 << "Chromoting Me2Me native messaging host."; | 595 << "Chromoting Me2Me native messaging host."; |
| 594 OnError(); | 596 OnError(); |
| 595 return; | 597 return; |
| 596 } | 598 } |
| 597 | 599 |
| 598 SECURITY_ATTRIBUTES security_attributes = {0}; | 600 SECURITY_ATTRIBUTES security_attributes = {0}; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 | 733 |
| 732 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( | 734 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( |
| 733 scoped_ptr<base::DictionaryValue> message) { | 735 scoped_ptr<base::DictionaryValue> message) { |
| 734 NOTREACHED(); | 736 NOTREACHED(); |
| 735 return false; | 737 return false; |
| 736 } | 738 } |
| 737 | 739 |
| 738 #endif // !defined(OS_WIN) | 740 #endif // !defined(OS_WIN) |
| 739 | 741 |
| 740 } // namespace remoting | 742 } // namespace remoting |
| OLD | NEW |