| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef SANDBOX_SRC_ACL_H_ | 5 #ifndef SANDBOX_SRC_ACL_H_ |
| 6 #define SANDBOX_SRC_ACL_H_ | 6 #define SANDBOX_SRC_ACL_H_ |
| 7 | 7 |
| 8 #include <AccCtrl.h> | 8 #include <AccCtrl.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "base/memory/free_deleter.h" | 13 #include "base/memory/free_deleter.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "sandbox/win/src/sid.h" | 14 #include "sandbox/win/src/sid.h" |
| 14 | 15 |
| 15 namespace sandbox { | 16 namespace sandbox { |
| 16 | 17 |
| 17 // Returns the default dacl from the token passed in. | 18 // Returns the default dacl from the token passed in. |
| 18 bool GetDefaultDacl( | 19 bool GetDefaultDacl( |
| 19 HANDLE token, | 20 HANDLE token, |
| 20 scoped_ptr<TOKEN_DEFAULT_DACL, base::FreeDeleter>* default_dacl); | 21 std::unique_ptr<TOKEN_DEFAULT_DACL, base::FreeDeleter>* default_dacl); |
| 21 | 22 |
| 22 // Appends an ACE represented by |sid|, |access_mode|, and |access| to | 23 // Appends an ACE represented by |sid|, |access_mode|, and |access| to |
| 23 // |old_dacl|. If the function succeeds, new_dacl contains the new dacl and | 24 // |old_dacl|. If the function succeeds, new_dacl contains the new dacl and |
| 24 // must be freed using LocalFree. | 25 // must be freed using LocalFree. |
| 25 bool AddSidToDacl(const Sid& sid, ACL* old_dacl, ACCESS_MODE access_mode, | 26 bool AddSidToDacl(const Sid& sid, ACL* old_dacl, ACCESS_MODE access_mode, |
| 26 ACCESS_MASK access, ACL** new_dacl); | 27 ACCESS_MASK access, ACL** new_dacl); |
| 27 | 28 |
| 28 // Adds an ACE represented by |sid| and |access| with |access_mode| to the | 29 // Adds an ACE represented by |sid| and |access| with |access_mode| to the |
| 29 // default dacl present in the token. | 30 // default dacl present in the token. |
| 30 bool AddSidToDefaultDacl(HANDLE token, | 31 bool AddSidToDefaultDacl(HANDLE token, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 42 // Adds an ACE represented by |known_sid|, |access_mode|, and |access| to | 43 // Adds an ACE represented by |known_sid|, |access_mode|, and |access| to |
| 43 // the dacl of the kernel object referenced by |object| and of |object_type|. | 44 // the dacl of the kernel object referenced by |object| and of |object_type|. |
| 44 bool AddKnownSidToObject(HANDLE object, SE_OBJECT_TYPE object_type, | 45 bool AddKnownSidToObject(HANDLE object, SE_OBJECT_TYPE object_type, |
| 45 const Sid& sid, ACCESS_MODE access_mode, | 46 const Sid& sid, ACCESS_MODE access_mode, |
| 46 ACCESS_MASK access); | 47 ACCESS_MASK access); |
| 47 | 48 |
| 48 } // namespace sandbox | 49 } // namespace sandbox |
| 49 | 50 |
| 50 | 51 |
| 51 #endif // SANDBOX_SRC_ACL_H_ | 52 #endif // SANDBOX_SRC_ACL_H_ |
| OLD | NEW |