1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r14432: Give in and grant BUILT\Administrators all privileges

(This used to be commit b617091060)
This commit is contained in:
Gerald Carter 2006-03-15 05:50:52 +00:00 committed by Gerald (Jerry) Carter
parent d6eebce490
commit f39c02e945
2 changed files with 25 additions and 2 deletions

View File

@ -288,12 +288,17 @@ BOOL init_account_policy(void)
/* These exist by default on NT4 in [HKLM\SECURITY\Policy\Accounts] */
privilege_create_account( &global_sid_World );
privilege_create_account( &global_sid_Builtin_Administrators );
privilege_create_account( &global_sid_Builtin_Account_Operators );
privilege_create_account( &global_sid_Builtin_Server_Operators );
privilege_create_account( &global_sid_Builtin_Print_Operators );
privilege_create_account( &global_sid_Builtin_Backup_Operators );
/* BUILTIN\Administrators get everything -- *always* */
if ( !grant_all_privileges( &global_sid_Builtin_Administrators ) ) {
DEBUG(0,("init_account_policy: Failed to grant privileges to BUILTIN\\Administrators!\n"));
}
return True;
}

View File

@ -867,9 +867,27 @@ BOOL privilege_set_to_se_priv( SE_PRIV *mask, PRIVILEGE_SET *privset )
/*******************************************************************
*******************************************************************/
BOOL is_privileged_sid( DOM_SID *sid )
BOOL is_privileged_sid( const DOM_SID *sid )
{
SE_PRIV mask;
return get_privileges( sid, &mask );
}
/*******************************************************************
*******************************************************************/
BOOL grant_all_privileges( const DOM_SID *sid )
{
int i;
SE_PRIV mask;
uint32 num_privs = count_all_privileges();
se_priv_copy( &mask, &se_priv_none );
for ( i=0; i<num_privs; i++ ) {
se_priv_add(&mask, &privs[i].se_priv);
}
return grant_privilege( sid, &mask );
}