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

Side by Side Diff: sandbox/win/src/acl.h

Issue 1821193002: Added a policy option to restrict the default DACL for tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 (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 "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "sandbox/win/src/sid.h" 12 #include "sandbox/win/src/sid.h"
13 13
14 namespace sandbox { 14 namespace sandbox {
15 15
16 // Returns the default dacl from the token passed in. 16 // Returns the default dacl from the token passed in.
17 bool GetDefaultDacl( 17 bool GetDefaultDacl(
18 HANDLE token, 18 HANDLE token,
19 scoped_ptr<TOKEN_DEFAULT_DACL, base::FreeDeleter>* default_dacl); 19 scoped_ptr<TOKEN_DEFAULT_DACL, base::FreeDeleter>* default_dacl);
20 20
21 // Appends an ACE represented by |sid|, |access_mode|, and |access| to 21 // Appends an ACE represented by |sid|, |access_mode|, and |access| to
22 // |old_dacl|. If the function succeeds, new_dacl contains the new dacl and 22 // |old_dacl|. If the function succeeds, new_dacl contains the new dacl and
23 // must be freed using LocalFree. 23 // must be freed using LocalFree.
24 bool AddSidToDacl(const Sid& sid, ACL* old_dacl, ACCESS_MODE access_mode, 24 bool AddSidToDacl(const Sid& sid, ACL* old_dacl, ACCESS_MODE access_mode,
25 ACCESS_MASK access, ACL** new_dacl); 25 ACCESS_MASK access, ACL** new_dacl);
26 26
27 // Adds and ACE represented by |sid| and |access| to the default dacl present 27 // Adds an ACE represented by |sid| and |access| to the default dacl present
28 // in the token. 28 // in the token.
29 bool AddSidToDefaultDacl(HANDLE token, const Sid& sid, ACCESS_MASK access); 29 bool AddSidToDefaultDacl(HANDLE token, const Sid& sid, ACCESS_MASK access);
30 30
31 // Adds an ACE represented by |sid| and |access| with |access_mode| to the
32 // default dacl present in the token.
33 bool AddSidToDefaultDacl(HANDLE token,
Will Harris 2016/03/27 01:20:05 are there really that many users of AddSidToDefaul
forshaw 2016/03/28 16:40:31 Done.
34 const Sid& sid,
35 ACCESS_MODE access_mode,
36 ACCESS_MASK access);
37
38 // Adds a deny ACE represented by |sid| and |access| to the default dacl
39 // present in the token.
40 bool AddDenySidToDefaultDacl(HANDLE token, const Sid& sid, ACCESS_MASK access);
41
42 // Revokes access to the logon SID for the default dacl present in the token.
43 bool RevokeLogonSidFromDefaultDacl(HANDLE token);
44
31 // Adds an ACE represented by the user sid and |access| to the default dacl 45 // Adds an ACE represented by the user sid and |access| to the default dacl
32 // present in the token. 46 // present in the token.
33 bool AddUserSidToDefaultDacl(HANDLE token, ACCESS_MASK access); 47 bool AddUserSidToDefaultDacl(HANDLE token, ACCESS_MASK access);
34 48
35 // Adds an ACE represented by |known_sid|, |access_mode|, and |access| to 49 // Adds an ACE represented by |known_sid|, |access_mode|, and |access| to
36 // the dacl of the kernel object referenced by |object| and of |object_type|. 50 // the dacl of the kernel object referenced by |object| and of |object_type|.
37 bool AddKnownSidToObject(HANDLE object, SE_OBJECT_TYPE object_type, 51 bool AddKnownSidToObject(HANDLE object, SE_OBJECT_TYPE object_type,
38 const Sid& sid, ACCESS_MODE access_mode, 52 const Sid& sid, ACCESS_MODE access_mode,
39 ACCESS_MASK access); 53 ACCESS_MASK access);
40 54
41 } // namespace sandbox 55 } // namespace sandbox
42 56
43 57
44 #endif // SANDBOX_SRC_ACL_H_ 58 #endif // SANDBOX_SRC_ACL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698