mirror of https://github.com/BOINC/boinc.git
WINBUILD: Add custom actions to remove the locally created users and groups when uninstalling a service install.
This commit is contained in:
parent
a862fa58f4
commit
44d8c63ff1
|
@ -0,0 +1,155 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2014 University of California
|
||||
//
|
||||
// This 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 software 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.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "boinccas.h"
|
||||
#include "CADeleteBOINCAccounts.h"
|
||||
#include "lsaprivs.h"
|
||||
#include "password.h"
|
||||
|
||||
|
||||
#define CUSTOMACTION_NAME _T("CADeleteBOINCAccounts")
|
||||
#define CUSTOMACTION_PROGRESSTITLE _T("Validating user accounts used by BOINC for secure sandboxes")
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CADeleteBOINCAccounts::CADeleteBOINCAccounts(MSIHANDLE hMSIHandle) :
|
||||
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
|
||||
{}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CADeleteBOINCAccounts::~CADeleteBOINCAccounts()
|
||||
{
|
||||
BOINCCABase::~BOINCCABase();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT CADeleteBOINCAccounts::OnExecution()
|
||||
{
|
||||
tstring strBOINCMasterAccountUsername;
|
||||
tstring strBOINCProjectAccountUsername;
|
||||
NET_API_STATUS nasReturnValue;
|
||||
UINT uiReturnValue = -1;
|
||||
|
||||
uiReturnValue = GetProperty( _T("BOINC_MASTER_USERNAME"), strBOINCMasterAccountUsername );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
uiReturnValue = GetProperty( _T("BOINC_PROJECT_USERNAME"), strBOINCProjectAccountUsername );
|
||||
if ( uiReturnValue ) return uiReturnValue;
|
||||
|
||||
|
||||
// Delete 'boinc_master' account
|
||||
//
|
||||
nasReturnValue = NetUserDel(
|
||||
NULL,
|
||||
(LPWSTR)strBOINCMasterAccountUsername.c_str()
|
||||
);
|
||||
|
||||
if (NERR_Success != nasReturnValue) {
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("NetUserDel retval")
|
||||
);
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_ERROR,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("Failed to delete the 'boinc_master' account.")
|
||||
);
|
||||
return ERROR_INSTALL_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
// Delete 'boinc_project' account
|
||||
//
|
||||
nasReturnValue = NetUserDel(
|
||||
NULL,
|
||||
(LPWSTR)strBOINCProjectAccountUsername.c_str()
|
||||
);
|
||||
|
||||
if (NERR_Success != nasReturnValue) {
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("NetUserDel retval")
|
||||
);
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_ERROR,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("Failed to delete the 'boinc_project' account.")
|
||||
);
|
||||
return ERROR_INSTALL_FAILURE;
|
||||
}
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: DeleteBOINCAccounts
|
||||
//
|
||||
// Description: This custom action delete the two user accounts that
|
||||
// are used to enfore the account based sandboxing scheme
|
||||
// on Windows.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT __stdcall DeleteBOINCAccounts(MSIHANDLE hInstall)
|
||||
{
|
||||
UINT uiReturnValue = 0;
|
||||
|
||||
CADeleteBOINCAccounts* pCA = new CADeleteBOINCAccounts(hInstall);
|
||||
uiReturnValue = pCA->Execute();
|
||||
delete pCA;
|
||||
|
||||
return uiReturnValue;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2014 University of California
|
||||
//
|
||||
// This 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 software 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.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
|
||||
#ifndef _CADELETEBOINCACCOUNTS_H_
|
||||
#define _CADELETEBOINCACCOUNTS_H_
|
||||
|
||||
|
||||
class CADeleteBOINCAccounts : public BOINCCABase
|
||||
{
|
||||
public:
|
||||
|
||||
CADeleteBOINCAccounts(MSIHANDLE hMSIHandle);
|
||||
~CADeleteBOINCAccounts();
|
||||
virtual UINT OnExecution();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2014 University of California
|
||||
//
|
||||
// This 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 software 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.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "boinccas.h"
|
||||
#include "CADeleteBOINCGroups.h"
|
||||
#include "lsaprivs.h"
|
||||
|
||||
|
||||
#define CUSTOMACTION_NAME _T("CADeleteBOINCGroups")
|
||||
#define CUSTOMACTION_PROGRESSTITLE _T("Validating user groups used by BOINC for secure sandboxes")
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CADeleteBOINCGroups::CADeleteBOINCGroups(MSIHANDLE hMSIHandle) :
|
||||
BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE)
|
||||
{}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
CADeleteBOINCGroups::~CADeleteBOINCGroups()
|
||||
{
|
||||
BOINCCABase::~BOINCCABase();
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function:
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT CADeleteBOINCGroups::OnExecution()
|
||||
{
|
||||
NET_API_STATUS nasReturnValue;
|
||||
|
||||
// Delete the 'boinc_admins'
|
||||
//
|
||||
nasReturnValue = NetLocalGroupDel(
|
||||
NULL,
|
||||
_T("boinc_admins")
|
||||
);
|
||||
|
||||
if ((NERR_Success != nasReturnValue) && (ERROR_ALIAS_EXISTS != nasReturnValue)) {
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("NetLocalGroupDel retval")
|
||||
);
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_ERROR,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("Failed to delete the 'boinc_admins' group.")
|
||||
);
|
||||
return ERROR_INSTALL_FAILURE;
|
||||
}
|
||||
|
||||
// Delete the 'boinc_users'
|
||||
//
|
||||
nasReturnValue = NetLocalGroupDel(
|
||||
NULL,
|
||||
_T("boinc_users")
|
||||
);
|
||||
|
||||
if ((NERR_Success != nasReturnValue) && (ERROR_ALIAS_EXISTS != nasReturnValue)) {
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("NetLocalGroupDel retval")
|
||||
);
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_ERROR,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("Failed to Delete the 'boinc_users' group.")
|
||||
);
|
||||
return ERROR_INSTALL_FAILURE;
|
||||
}
|
||||
|
||||
// Delete the 'boinc_projects'
|
||||
//
|
||||
nasReturnValue = NetLocalGroupDel(
|
||||
NULL,
|
||||
_T("boinc_projects")
|
||||
);
|
||||
|
||||
if ((NERR_Success != nasReturnValue) && (ERROR_ALIAS_EXISTS != nasReturnValue)) {
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_INFO,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("NetLocalGroupDel retval")
|
||||
);
|
||||
LogMessage(
|
||||
INSTALLMESSAGE_ERROR,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
nasReturnValue,
|
||||
_T("Failed to remove the 'boinc_projects' group.")
|
||||
);
|
||||
return ERROR_INSTALL_FAILURE;
|
||||
}
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Function: DeleteBOINCGroups
|
||||
//
|
||||
// Description: This custom action deletes the three user groups that
|
||||
// are used to enfore the account based sandboxing scheme
|
||||
// on Windows.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
UINT __stdcall DeleteBOINCGroups(MSIHANDLE hInstall)
|
||||
{
|
||||
UINT uiReturnValue = 0;
|
||||
|
||||
CADeleteBOINCGroups* pCA = new CADeleteBOINCGroups(hInstall);
|
||||
uiReturnValue = pCA->Execute();
|
||||
delete pCA;
|
||||
|
||||
return uiReturnValue;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2014 University of California
|
||||
//
|
||||
// This 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 software 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.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
|
||||
#ifndef _CADELETEBOINCGROUPS_H_
|
||||
#define _CADELETEBOINCGROUPS_H_
|
||||
|
||||
|
||||
class CADeleteBOINCGroups : public BOINCCABase
|
||||
{
|
||||
public:
|
||||
|
||||
CADeleteBOINCGroups(MSIHANDLE hMSIHandle);
|
||||
~CADeleteBOINCGroups();
|
||||
virtual UINT OnExecution();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -94,60 +94,20 @@ UINT CAGrantBOINCAdminsRights::OnExecution()
|
|||
// most cases.
|
||||
|
||||
// User Rights
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeNetworkLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeNetworkLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeRemoteInteractiveLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeRemoteInteractiveLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeBatchLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeBatchLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeInteractiveLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeInteractiveLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeServiceLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeServiceLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeDenyNetworkLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeDenyNetworkLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeDenyInteractiveLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeDenyInteractiveLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeDenyBatchLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeDenyBatchLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeDenyServiceLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeDenyServiceLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
// Windows 2000 and older does not have the SeDenyRemoteInteractiveLogonRight user right
|
||||
//
|
||||
if (strOSVersion > _T("500")) {
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeDenyRemoteInteractiveLogonRight' right."));
|
||||
GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
}
|
||||
GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", FALSE);
|
||||
|
||||
// Privileges
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeTcbPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeTcbPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeMachineAccountPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeMachineAccountPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeIncreaseQuotaPrivilege' right."));
|
||||
if (!GrantUserRight(pSid, L"SeIncreaseQuotaPrivilege", TRUE))
|
||||
{
|
||||
LogMessage(
|
||||
|
@ -159,13 +119,7 @@ UINT CAGrantBOINCAdminsRights::OnExecution()
|
|||
_T("Failed call to GrantUserRight - SeIncreaseQuotaPrivilege")
|
||||
);
|
||||
}
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeBackupPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeBackupPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeChangeNotifyPrivilege' right."));
|
||||
if (!GrantUserRight(pSid, L"SeChangeNotifyPrivilege", TRUE))
|
||||
{
|
||||
LogMessage(
|
||||
|
@ -177,21 +131,9 @@ UINT CAGrantBOINCAdminsRights::OnExecution()
|
|||
_T("Failed call to GrantUserRight - SeChangeNotifyPrivilege")
|
||||
);
|
||||
}
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeSystemTimePrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeSystemTimePrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeCreateTokenPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeCreateTokenPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeCreatePagefilePrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeCreatePagefilePrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeCreateGlobalPrivilege' right."));
|
||||
if (!GrantUserRight(pSid, L"SeCreateGlobalPrivilege", TRUE))
|
||||
{
|
||||
LogMessage(
|
||||
|
@ -203,65 +145,20 @@ UINT CAGrantBOINCAdminsRights::OnExecution()
|
|||
_T("Failed call to GrantUserRight - SeCreateGlobalPrivilege")
|
||||
);
|
||||
}
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeDebugPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeDebugPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeEnableDelegationPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeEnableDelegationPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeRemoteShutdownPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeRemoteShutdownPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeAuditPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeAuditPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeImpersonatePrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeImpersonatePrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeIncreaseBasePriorityPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeIncreaseBasePriorityPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeLoadDriverPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeLoadDriverPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeLockMemoryPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeLockMemoryPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeSecurityPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeSecurityPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeSystemEnvironmentPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeSystemEnvironmentPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeManageVolumePrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeManageVolumePrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeProfileSingleProcessPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeProfileSingleProcessPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeSystemProfilePrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeSystemProfilePrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeUndockPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeUndockPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeAssignPrimaryTokenPrivilege' right."));
|
||||
if (!GrantUserRight(pSid, L"SeAssignPrimaryTokenPrivilege", TRUE))
|
||||
{
|
||||
LogMessage(
|
||||
|
@ -273,24 +170,10 @@ UINT CAGrantBOINCAdminsRights::OnExecution()
|
|||
_T("Failed call to GrantUserRight - SeAssignPrimaryTokenPrivilege")
|
||||
);
|
||||
}
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeRestorePrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeRestorePrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeShutdownPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeShutdownPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeSynchAgentPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeSynchAgentPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeTakeOwnershipPrivilege' right."));
|
||||
GrantUserRight(pSid, L"SeTakeOwnershipPrivilege", FALSE);
|
||||
LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed."));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -47,3 +47,5 @@ EXPORTS
|
|||
RevokeBOINCProjectRights
|
||||
RevokeBOINCProjectsRights
|
||||
RevokeBOINCUsersRights
|
||||
DeleteBOINCGroups
|
||||
DeleteBOINCAccounts
|
||||
|
|
|
@ -214,6 +214,8 @@
|
|||
<ClCompile Include="CACreateBOINCGroups.cpp" />
|
||||
<ClCompile Include="CACreateClientAuthFile.cpp" />
|
||||
<ClCompile Include="CACreateProjectInitFile.cpp" />
|
||||
<ClCompile Include="CADeleteBOINCAccounts.cpp" />
|
||||
<ClCompile Include="CADeleteBOINCGroups.cpp" />
|
||||
<ClCompile Include="CAGetAdministratorsGroupName.cpp" />
|
||||
<ClCompile Include="CAGetUsersGroupName.cpp" />
|
||||
<ClCompile Include="CAGrantBOINCAdminsRights.cpp" />
|
||||
|
@ -274,6 +276,8 @@
|
|||
<ClInclude Include="CACreateBOINCGroups.h" />
|
||||
<ClInclude Include="CACreateClientAuthFile.h" />
|
||||
<ClInclude Include="CACreateProjectInitFile.h" />
|
||||
<ClInclude Include="CADeleteBOINCAccounts.h" />
|
||||
<ClInclude Include="CADeleteBOINCGroups.h" />
|
||||
<ClInclude Include="CAGetAdministratorsGroupName.h" />
|
||||
<ClInclude Include="CAGetUsersGroupName.h" />
|
||||
<ClInclude Include="CAGrantBOINCAdminsRights.h" />
|
||||
|
|
Loading…
Reference in New Issue