blob: 191688d3f13ffda2b6c39649e579c49ec9c8e077 [file] [log] [blame]
Robert Shearmand2ea92d2005-04-22 21:17:15 +00001/*
2 * Security Management
3 *
4 * Copyright (C) 2005 Robert Shearman
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
Jonathan Ernst360a3f92006-05-18 14:49:52 +020018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Robert Shearmand2ea92d2005-04-22 21:17:15 +000019 */
20
21extern const LUID SeIncreaseQuotaPrivilege;
22extern const LUID SeSecurityPrivilege;
23extern const LUID SeTakeOwnershipPrivilege;
24extern const LUID SeLoadDriverPrivilege;
25extern const LUID SeSystemProfilePrivilege;
26extern const LUID SeSystemtimePrivilege;
27extern const LUID SeProfileSingleProcessPrivilege;
28extern const LUID SeIncreaseBasePriorityPrivilege;
29extern const LUID SeCreatePagefilePrivilege;
30extern const LUID SeBackupPrivilege;
31extern const LUID SeRestorePrivilege;
32extern const LUID SeShutdownPrivilege;
33extern const LUID SeDebugPrivilege;
34extern const LUID SeSystemEnvironmentPrivilege;
35extern const LUID SeChangeNotifyPrivilege;
36extern const LUID SeRemoteShutdownPrivilege;
37extern const LUID SeUndockPrivilege;
38extern const LUID SeManageVolumePrivilege;
39extern const LUID SeImpersonatePrivilege;
40extern const LUID SeCreateGlobalPrivilege;
41
Robert Shearman91eaea52005-07-18 13:22:55 +000042extern const PSID security_interactive_sid;
43
Robert Shearmand2ea92d2005-04-22 21:17:15 +000044extern struct token *token_create_admin(void);
45extern int token_check_privileges( struct token *token, int all_required,
46 const LUID_AND_ATTRIBUTES *reqprivs,
47 unsigned int count, LUID_AND_ATTRIBUTES *usedprivs);
Robert Shearmanfbf0ea92005-07-13 19:31:27 +000048extern const ACL *token_get_default_dacl( struct token *token );
Robert Shearman4bba2162005-06-20 13:18:38 +000049extern void security_set_thread_token( struct thread *thread, obj_handle_t handle );
Robert Shearmand2ea92d2005-04-22 21:17:15 +000050
51static inline int thread_single_check_privilege( struct thread *thread, const LUID *priv)
52{
53 struct token *token = thread_get_impersonation_token( thread );
54 const LUID_AND_ATTRIBUTES privs = { *priv, 0 };
55
56 if (!token) return FALSE;
57
58 return token_check_privileges( token, TRUE, &privs, 1, NULL );
59}