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

Side by Side Diff: remoting/host/win/com_security.cc

Issue 2037163002: Removing WinXP and Vista specific code from Chromoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sas_be_gone
Patch Set: Doing a bit more trimming Created 4 years, 6 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
OLDNEW
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/win/com_security.h" 5 #include "remoting/host/win/com_security.h"
6 6
7 #include <objidl.h> 7 #include <objidl.h>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/win/windows_version.h"
12 #include "remoting/host/win/security_descriptor.h" 11 #include "remoting/host/win/security_descriptor.h"
13 12
14 namespace remoting { 13 namespace remoting {
15 14
16 bool InitializeComSecurity(const std::string& security_descriptor, 15 bool InitializeComSecurity(const std::string& security_descriptor,
17 const std::string& mandatory_label, 16 const std::string& mandatory_label,
18 bool activate_as_activator) { 17 bool activate_as_activator) {
19 std::string sddl = security_descriptor; 18 std::string sddl = security_descriptor + mandatory_label;
Jamie 2016/06/06 18:05:18 Does it still make sense to separate these paramet
Hzj_jie 2016/06/06 18:48:54 +1
joedow 2016/06/06 22:49:45 Acknowledged. I looked at the two call sites and
20 if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
21 sddl += mandatory_label;
22 }
23 19
24 // Convert the SDDL description into a security descriptor in absolute format. 20 // Convert the SDDL description into a security descriptor in absolute format.
25 ScopedSd relative_sd = ConvertSddlToSd(sddl); 21 ScopedSd relative_sd = ConvertSddlToSd(sddl);
26 if (!relative_sd) { 22 if (!relative_sd) {
27 PLOG(ERROR) << "Failed to create a security descriptor"; 23 PLOG(ERROR) << "Failed to create a security descriptor";
28 return false; 24 return false;
29 } 25 }
30 ScopedSd absolute_sd; 26 ScopedSd absolute_sd;
31 ScopedAcl dacl; 27 ScopedAcl dacl;
32 ScopedSid group; 28 ScopedSid group;
(...skipping 24 matching lines...) Expand all
57 if (FAILED(result)) { 53 if (FAILED(result)) {
58 LOG(ERROR) << "CoInitializeSecurity() failed, result=0x" 54 LOG(ERROR) << "CoInitializeSecurity() failed, result=0x"
59 << std::hex << result << std::dec << "."; 55 << std::hex << result << std::dec << ".";
60 return false; 56 return false;
61 } 57 }
62 58
63 return true; 59 return true;
64 } 60 }
65 61
66 } // namespace remoting 62 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698