2005-04-22 23:17:15 +02:00
|
|
|
/*
|
|
|
|
* Security Management
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Robert Shearman
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-04-22 23:17:15 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
extern const LUID SeIncreaseQuotaPrivilege;
|
|
|
|
extern const LUID SeSecurityPrivilege;
|
|
|
|
extern const LUID SeTakeOwnershipPrivilege;
|
|
|
|
extern const LUID SeLoadDriverPrivilege;
|
|
|
|
extern const LUID SeSystemProfilePrivilege;
|
|
|
|
extern const LUID SeSystemtimePrivilege;
|
|
|
|
extern const LUID SeProfileSingleProcessPrivilege;
|
|
|
|
extern const LUID SeIncreaseBasePriorityPrivilege;
|
|
|
|
extern const LUID SeCreatePagefilePrivilege;
|
|
|
|
extern const LUID SeBackupPrivilege;
|
|
|
|
extern const LUID SeRestorePrivilege;
|
|
|
|
extern const LUID SeShutdownPrivilege;
|
|
|
|
extern const LUID SeDebugPrivilege;
|
|
|
|
extern const LUID SeSystemEnvironmentPrivilege;
|
|
|
|
extern const LUID SeChangeNotifyPrivilege;
|
|
|
|
extern const LUID SeRemoteShutdownPrivilege;
|
|
|
|
extern const LUID SeUndockPrivilege;
|
|
|
|
extern const LUID SeManageVolumePrivilege;
|
|
|
|
extern const LUID SeImpersonatePrivilege;
|
|
|
|
extern const LUID SeCreateGlobalPrivilege;
|
|
|
|
|
2005-07-18 15:22:55 +02:00
|
|
|
extern const PSID security_interactive_sid;
|
|
|
|
|
2005-04-22 23:17:15 +02:00
|
|
|
extern struct token *token_create_admin(void);
|
2007-05-28 19:39:33 +02:00
|
|
|
extern struct token *token_duplicate( struct token *src_token, unsigned primary,
|
|
|
|
SECURITY_IMPERSONATION_LEVEL impersonation_level );
|
2005-04-22 23:17:15 +02:00
|
|
|
extern int token_check_privileges( struct token *token, int all_required,
|
|
|
|
const LUID_AND_ATTRIBUTES *reqprivs,
|
|
|
|
unsigned int count, LUID_AND_ATTRIBUTES *usedprivs);
|
2005-07-13 21:31:27 +02:00
|
|
|
extern const ACL *token_get_default_dacl( struct token *token );
|
2005-06-20 15:18:38 +02:00
|
|
|
extern void security_set_thread_token( struct thread *thread, obj_handle_t handle );
|
2007-02-21 14:59:59 +01:00
|
|
|
extern int check_object_access( struct object *obj, unsigned int *access );
|
2005-04-22 23:17:15 +02:00
|
|
|
|
|
|
|
static inline int thread_single_check_privilege( struct thread *thread, const LUID *priv)
|
|
|
|
{
|
|
|
|
struct token *token = thread_get_impersonation_token( thread );
|
|
|
|
const LUID_AND_ATTRIBUTES privs = { *priv, 0 };
|
|
|
|
|
|
|
|
if (!token) return FALSE;
|
|
|
|
|
|
|
|
return token_check_privileges( token, TRUE, &privs, 1, NULL );
|
|
|
|
}
|