OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SANDBOX_SRC_ACL_H_ | |
6 #define SANDBOX_SRC_ACL_H_ | |
7 | |
8 #include <AccCtrl.h> | |
9 #include <windows.h> | |
10 | |
11 #include "base/memory/free_deleter.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "sandbox/win/src/sid.h" | |
14 | |
15 namespace sandbox { | |
16 | |
17 // Returns the default dacl from the token passed in. | |
18 bool GetDefaultDacl( | |
19 HANDLE token, | |
20 scoped_ptr<TOKEN_DEFAULT_DACL, base::FreeDeleter>* default_dacl); | |
21 | |
22 // 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 // must be freed using LocalFree. | |
25 bool AddSidToDacl(const Sid& sid, ACL* old_dacl, ACCESS_MODE access_mode, | |
26 ACCESS_MASK access, ACL** new_dacl); | |
27 | |
28 // Adds an ACE represented by |sid| and |access| with |access_mode| to the | |
29 // default dacl present in the token. | |
30 bool AddSidToDefaultDacl(HANDLE token, | |
31 const Sid& sid, | |
32 ACCESS_MODE access_mode, | |
33 ACCESS_MASK access); | |
34 | |
35 // Revokes access to the logon SID for the default dacl present in the token. | |
36 bool RevokeLogonSidFromDefaultDacl(HANDLE token); | |
37 | |
38 // Adds an ACE represented by the user sid and |access| to the default dacl | |
39 // present in the token. | |
40 bool AddUserSidToDefaultDacl(HANDLE token, ACCESS_MASK access); | |
41 | |
42 // 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 bool AddKnownSidToObject(HANDLE object, SE_OBJECT_TYPE object_type, | |
45 const Sid& sid, ACCESS_MODE access_mode, | |
46 ACCESS_MASK access); | |
47 | |
48 } // namespace sandbox | |
49 | |
50 | |
51 #endif // SANDBOX_SRC_ACL_H_ | |
OLD | NEW |