From 378561d155e021d4257fb1c27dc2b0cfaac52279 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 12 Dec 2008 21:47:38 +0000 Subject: [PATCH] - WINSETUP: Make sure we don't try and do anything with the SeDenyRemoteInteractiveLogonRight user right on Windows 2000 or older. Fixes #789 win_build/installerv2/redist/Windows/src/boinccas/ boinccas.rc CAGrantBOINCAdminsRights.cpp CAGrantBOINCMasterRights.cpp CAGrantBOINCProjectRights.cpp CAGrantBOINCProjectsRights.cpp CAGrantBOINCUsersRights.cpp svn path=/trunk/boinc/; revision=16674 --- checkin_notes | 13 +++++++++ .../src/boinccas/CAGrantBOINCAdminsRights.cpp | 16 ++++++++-- .../src/boinccas/CAGrantBOINCMasterRights.cpp | 29 ++++++++++++------- .../boinccas/CAGrantBOINCProjectRights.cpp | 28 +++++++++++------- .../boinccas/CAGrantBOINCProjectsRights.cpp | 14 ++++++++- .../src/boinccas/CAGrantBOINCUsersRights.cpp | 14 ++++++++- .../redist/Windows/src/boinccas/boinccas.rc | 8 ++--- 7 files changed, 93 insertions(+), 29 deletions(-) diff --git a/checkin_notes b/checkin_notes index 6588d74c58..4ab222979f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -10052,3 +10052,16 @@ David 12 Dec 2008 sched/ sched_config.cpp,h sched_send.cpp + +Rom 12 Dec 2008 + - WINSETUP: Make sure we don't try and do anything with the + SeDenyRemoteInteractiveLogonRight user right on Windows + 2000 or older. Fixes #789 + + win_build/installerv2/redist/Windows/src/boinccas/ + boinccas.rc + CAGrantBOINCAdminsRights.cpp + CAGrantBOINCMasterRights.cpp + CAGrantBOINCProjectRights.cpp + CAGrantBOINCProjectsRights.cpp + CAGrantBOINCUsersRights.cpp diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCAdminsRights.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCAdminsRights.cpp index 0332e92cee..f5a047cdcb 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCAdminsRights.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCAdminsRights.cpp @@ -63,8 +63,14 @@ CAGrantBOINCAdminsRights::~CAGrantBOINCAdminsRights() UINT CAGrantBOINCAdminsRights::OnExecution() { PSID pSid; + tstring strOSVersion; UINT uiReturnValue = -1; + + uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion ); + if ( uiReturnValue ) return uiReturnValue; + + // // Obtain the SID of the user/group. // Note that we could target a specific machine, but we don't. @@ -124,9 +130,13 @@ UINT CAGrantBOINCAdminsRights::OnExecution() GrantUserRight(pSid, L"SeDenyServiceLogonRight", FALSE); LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Check completed.")); - 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.")); + // 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.")); + } // Privileges LogMessage(INSTALLMESSAGE_INFO, NULL, NULL, NULL, NULL, _T("Checking the 'SeTcbPrivilege' right.")); diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCMasterRights.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCMasterRights.cpp index 3665f61f8d..2d20a48353 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCMasterRights.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCMasterRights.cpp @@ -64,12 +64,16 @@ UINT CAGrantBOINCMasterRights::OnExecution() { PSID pSid; tstring strBOINCMasterAccountUsername; + tstring strOSVersion; UINT uiReturnValue = -1; uiReturnValue = GetProperty( _T("BOINC_MASTER_USERNAME"), strBOINCMasterAccountUsername ); if ( uiReturnValue ) return uiReturnValue; + uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion ); + if ( uiReturnValue ) return uiReturnValue; + // // Obtain the SID of the user/group. @@ -128,18 +132,23 @@ UINT CAGrantBOINCMasterRights::OnExecution() GrantUserRight(pSid, L"SeDenyBatchLogonRight", FALSE); GrantUserRight(pSid, L"SeDenyServiceLogonRight", FALSE); - if (!GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", TRUE)) - { - LogMessage( - INSTALLMESSAGE_ERROR, - NULL, - NULL, - NULL, - NULL, - _T("Failed call to GrantUserRight - SeDenyRemoteInteractiveLogonRight") - ); + // Windows 2000 and older does not have the SeDenyRemoteInteractiveLogonRight user right + // + if (strOSVersion > _T("500")) { + if (!GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", TRUE)) + { + LogMessage( + INSTALLMESSAGE_ERROR, + NULL, + NULL, + NULL, + NULL, + _T("Failed call to GrantUserRight - SeDenyRemoteInteractiveLogonRight") + ); + } } + // Privileges GrantUserRight(pSid, L"SeTcbPrivilege", FALSE); GrantUserRight(pSid, L"SeMachineAccountPrivilege", FALSE); diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCProjectRights.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCProjectRights.cpp index 876bab3557..33cf1817ec 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCProjectRights.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCProjectRights.cpp @@ -64,12 +64,16 @@ UINT CAGrantBOINCProjectRights::OnExecution() { PSID pSid; tstring strBOINCProjectAccountUsername; + tstring strOSVersion; UINT uiReturnValue = -1; uiReturnValue = GetProperty( _T("BOINC_PROJECT_USERNAME"), strBOINCProjectAccountUsername ); if ( uiReturnValue ) return uiReturnValue; + uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion ); + if ( uiReturnValue ) return uiReturnValue; + // // Obtain the SID of the user/group. @@ -138,16 +142,20 @@ UINT CAGrantBOINCProjectRights::OnExecution() GrantUserRight(pSid, L"SeDenyBatchLogonRight", FALSE); GrantUserRight(pSid, L"SeDenyServiceLogonRight", FALSE); - if (!GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", TRUE)) - { - LogMessage( - INSTALLMESSAGE_ERROR, - NULL, - NULL, - NULL, - NULL, - _T("Failed call to GrantUserRight - SeDenyRemoteInteractiveLogonRight") - ); + // Windows 2000 and older does not have the SeDenyRemoteInteractiveLogonRight user right + // + if (strOSVersion > _T("500")) { + if (!GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", TRUE)) + { + LogMessage( + INSTALLMESSAGE_ERROR, + NULL, + NULL, + NULL, + NULL, + _T("Failed call to GrantUserRight - SeDenyRemoteInteractiveLogonRight") + ); + } } // Privileges diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCProjectsRights.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCProjectsRights.cpp index 07b9522093..4a2f3a1b03 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCProjectsRights.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCProjectsRights.cpp @@ -63,8 +63,14 @@ CAGrantBOINCProjectsRights::~CAGrantBOINCProjectsRights() UINT CAGrantBOINCProjectsRights::OnExecution() { PSID pSid; + tstring strOSVersion; UINT uiReturnValue = -1; + + uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion ); + if ( uiReturnValue ) return uiReturnValue; + + // // Obtain the SID of the user/group. // Note that we could target a specific machine, but we don't. @@ -97,7 +103,13 @@ UINT CAGrantBOINCProjectsRights::OnExecution() GrantUserRight(pSid, L"SeDenyInteractiveLogonRight", FALSE); GrantUserRight(pSid, L"SeDenyBatchLogonRight", FALSE); GrantUserRight(pSid, L"SeDenyServiceLogonRight", FALSE); - GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", FALSE); + + // Windows 2000 and older does not have the SeDenyRemoteInteractiveLogonRight user right + // + if (strOSVersion > _T("500")) { + GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", FALSE); + } + // Privileges GrantUserRight(pSid, L"SeTcbPrivilege", FALSE); diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCUsersRights.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCUsersRights.cpp index c237e3fe5b..75322a3c07 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCUsersRights.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CAGrantBOINCUsersRights.cpp @@ -63,8 +63,14 @@ CAGrantBOINCUsersRights::~CAGrantBOINCUsersRights() UINT CAGrantBOINCUsersRights::OnExecution() { PSID pSid; + tstring strOSVersion; UINT uiReturnValue = -1; + + uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion ); + if ( uiReturnValue ) return uiReturnValue; + + // // Obtain the SID of the user/group. // Note that we could target a specific machine, but we don't. @@ -97,7 +103,13 @@ UINT CAGrantBOINCUsersRights::OnExecution() GrantUserRight(pSid, L"SeDenyInteractiveLogonRight", FALSE); GrantUserRight(pSid, L"SeDenyBatchLogonRight", FALSE); GrantUserRight(pSid, L"SeDenyServiceLogonRight", FALSE); - GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", FALSE); + + // Windows 2000 and older does not have the SeDenyRemoteInteractiveLogonRight user right + // + if (strOSVersion > _T("500")) { + GrantUserRight(pSid, L"SeDenyRemoteInteractiveLogonRight", FALSE); + } + // Privileges GrantUserRight(pSid, L"SeTcbPrivilege", FALSE); diff --git a/win_build/installerv2/redist/Windows/src/boinccas/boinccas.rc b/win_build/installerv2/redist/Windows/src/boinccas/boinccas.rc index 6ac6331dde..85ad47f80f 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/boinccas.rc +++ b/win_build/installerv2/redist/Windows/src/boinccas/boinccas.rc @@ -53,8 +53,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,120 - PRODUCTVERSION 1,0,0,120 + FILEVERSION 1,0,0,125 + PRODUCTVERSION 1,0,0,125 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -70,12 +70,12 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "BOINC Dynamic Link Library" - VALUE "FileVersion", "1.0.0.120" + VALUE "FileVersion", "1.0.0.125" VALUE "InternalName", "BOINC" VALUE "LegalCopyright", "Copyright (C) 2005-2008" VALUE "OriginalFilename", "BOINC.dll" VALUE "ProductName", " BOINC Dynamic Link Library" - VALUE "ProductVersion", "1.0.0.120" + VALUE "ProductVersion", "1.0.0.125" END END BLOCK "VarFileInfo"