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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 std::wstring user_sid; | 530 std::wstring user_sid; |
531 if (!base::win::GetUserSidString(&user_sid)) { | 531 if (!base::win::GetUserSidString(&user_sid)) { |
532 LOG(ERROR) << "Failed to query the current user SID."; | 532 LOG(ERROR) << "Failed to query the current user SID."; |
533 OnError(); | 533 OnError(); |
534 return; | 534 return; |
535 } | 535 } |
536 | 536 |
537 // Create a security descriptor that gives full access to the caller and | 537 // Create a security descriptor that gives full access to the caller and |
538 // denies access by anyone else. | 538 // denies access by anyone else. |
539 std::string security_descriptor = base::StringPrintf( | 539 std::string security_descriptor = base::StringPrintf( |
540 "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", WideToASCII(user_sid).c_str()); | 540 "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", base::UTF16ToASCII(user_sid).c_str()); |
541 | 541 |
542 ScopedSd sd = ConvertSddlToSd(security_descriptor); | 542 ScopedSd sd = ConvertSddlToSd(security_descriptor); |
543 if (!sd) { | 543 if (!sd) { |
544 LOG_GETLASTERROR(ERROR) << "Failed to create a security descriptor for the" | 544 LOG_GETLASTERROR(ERROR) << "Failed to create a security descriptor for the" |
545 << "Chromoting Me2Me native messaging host."; | 545 << "Chromoting Me2Me native messaging host."; |
546 OnError(); | 546 OnError(); |
547 return; | 547 return; |
548 } | 548 } |
549 | 549 |
550 SECURITY_ATTRIBUTES security_attributes = {0}; | 550 SECURITY_ATTRIBUTES security_attributes = {0}; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 | 691 |
692 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( | 692 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( |
693 scoped_ptr<base::DictionaryValue> message) { | 693 scoped_ptr<base::DictionaryValue> message) { |
694 NOTREACHED(); | 694 NOTREACHED(); |
695 return false; | 695 return false; |
696 } | 696 } |
697 | 697 |
698 #endif // !defined(OS_WIN) | 698 #endif // !defined(OS_WIN) |
699 | 699 |
700 } // namespace remoting | 700 } // namespace remoting |
OLD | NEW |