From 7477b7693522106e4ab7adbd386efa9b1c09ba5f Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Fri, 7 Apr 2023 17:22:54 +0200 Subject: [PATCH] 1.8.4 --- CHANGELOG.md | 3 ++- SandboxiePlus/SandMan/Models/SbieModel.cpp | 5 +++++ SandboxiePlus/SandMan/OnlineUpdater.cpp | 14 +++++++++++--- .../SandMan/Resources/Actions/AppContainer.png | Bin 0 -> 1651 bytes .../SandMan/Resources/Actions/Restricted.png | Bin 0 -> 1632 bytes SandboxiePlus/SandMan/Resources/SandMan.qrc | 2 ++ SandboxiePlus/SandMan/SandMan.cpp | 2 +- SandboxiePlus/SandMan/SbieProcess.cpp | 13 ++++++++++++- SandboxiePlus/SandMan/SbieProcess.h | 6 +++++- 9 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 SandboxiePlus/SandMan/Resources/Actions/AppContainer.png create mode 100644 SandboxiePlus/SandMan/Resources/Actions/Restricted.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 41060ca7..13aef336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - added installer icon +- added token type indicator to process list ### Fixed - fixed compatybility issue with MSEdge 112.x - +- fixed updter issue [#2790](https://github.com/sandboxie-plus/Sandboxie/issues/2790) diff --git a/SandboxiePlus/SandMan/Models/SbieModel.cpp b/SandboxiePlus/SandMan/Models/SbieModel.cpp index 619fcaad..d169cba8 100644 --- a/SandboxiePlus/SandMan/Models/SbieModel.cpp +++ b/SandboxiePlus/SandMan/Models/SbieModel.cpp @@ -391,6 +391,11 @@ bool CSbieModel::Sync(const CSandBoxPtr& pBox, const QList& Path, cons Icon = theGUI->IconAddOverlay(Icon, ":/Actions/SystemShield.png", 20); else if(pProcess->HasElevatedToken()) Icon = theGUI->IconAddOverlay(Icon, ":/Actions/AdminShield.png", 20); + else if(pProcess->HasAppContainerToken()) + Icon = theGUI->IconAddOverlay(Icon, ":/Actions/AppContainer.png", 20); // AppContainer is also Restricted + else if(pProcess->HasRestrictedToken()) + Icon = theGUI->IconAddOverlay(Icon, ":/Actions/Restricted.png", 20); + pNode->Icon = Icon; Changed = 1; diff --git a/SandboxiePlus/SandMan/OnlineUpdater.cpp b/SandboxiePlus/SandMan/OnlineUpdater.cpp index 40d459af..a1cdd811 100644 --- a/SandboxiePlus/SandMan/OnlineUpdater.cpp +++ b/SandboxiePlus/SandMan/OnlineUpdater.cpp @@ -417,7 +417,7 @@ bool COnlineUpdater::AskDownload(const QVariantMap& Data) mb.setCheckBoxVisible(m_CheckMode != eManual); if (!UpdateUrl.isEmpty() || !DownloadUrl.isEmpty() || Data.contains("files")) { - mb.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); + mb.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel); mb.setDefaultButton(QDialogButtonBox::Yes); } else @@ -434,8 +434,16 @@ bool COnlineUpdater::AskDownload(const QVariantMap& Data) else QDesktopServices::openUrl(UpdateUrl); } - else if (mb.isChecked()) - theConf->SetValue("Options/IgnoredUpdates", m_IgnoredUpdates << VersionStr); + else + { + if (mb.clickedStandardButton() == QDialogButtonBox::Cancel) { + theConf->SetValue("Updater/PendingUpdate", ""); + theGUI->UpdateLabel(); + } + + if (mb.isChecked()) + theConf->SetValue("Options/IgnoredUpdates", m_IgnoredUpdates << VersionStr); + } return false; } diff --git a/SandboxiePlus/SandMan/Resources/Actions/AppContainer.png b/SandboxiePlus/SandMan/Resources/Actions/AppContainer.png new file mode 100644 index 0000000000000000000000000000000000000000..5cb3e7404577928d5b77a21452f7ebe155665b2e GIT binary patch literal 1651 zcmV-(28{WMP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf6951U69E94oEQKA1_((+K~!i%?U`$A z6-5-s&+P5(!}1iYT2MeJCAPMeRFnV~6CMc<3Ez}bFh*iT`~ao_q9jP<5h%vQNHm&Q zD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zczI(|S9Sfy<$ zpC72)+vDkfBP35#Yq97;SrzOP{2-Q}#mfbO#Y3F&cQP$(CwU%`bZyx3<3+kqrn^`n z^hxPVCf2_2Nop&0000Actions/Editor2.png Actions/Folders.png IconSun.png + Actions/Restricted.png + Actions/AppContainer.png Boxes/sandbox-b-empty.png diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 59f51f4b..8a11b17e 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -1432,7 +1432,7 @@ void CSandMan::timerEvent(QTimerEvent* pEvent) bool bUpdatePending = !theConf->GetString("Updater/PendingUpdate").isEmpty(); - if (m_bIconEmpty != (ActiveProcesses == 0) || m_bIconBusy != bIconBusy || m_iIconDisabled != (bForceProcessDisabled ? 1 : 0) || bUpdatePending) + if (m_bIconEmpty != (ActiveProcesses == 0) || m_bIconBusy != bIconBusy || m_iIconDisabled != (bForceProcessDisabled ? 1 : 0) || bUpdatePending || m_bIconSun) { m_bIconEmpty = (ActiveProcesses == 0); m_bIconBusy = bIconBusy; diff --git a/SandboxiePlus/SandMan/SbieProcess.cpp b/SandboxiePlus/SandMan/SbieProcess.cpp index 1afe1801..35012d0b 100644 --- a/SandboxiePlus/SandMan/SbieProcess.cpp +++ b/SandboxiePlus/SandMan/SbieProcess.cpp @@ -110,7 +110,7 @@ QString CSbieProcess::GetStatusStr() const if (m_ProcessInfo.IsSystem) Status += tr(" as System"); - if(m_SessionId != theAPI->GetSessionID()) + if(m_SessionId != theAPI->GetSessionID() && m_SessionId != -1) Status += tr(" in session %1").arg(m_SessionId); quint32 ImageType = GetImageType(); @@ -146,6 +146,17 @@ void CSbieProcess::InitProcessInfoImpl(void* ProcessHandle) m_ProcessInfo.IsSystem = RtlEqualSid(((PTOKEN_USER)tokenUserBuff)->User.Sid, &SeLocalSystemSid); } + ULONG restricted; + if (NT_SUCCESS(NtQueryInformationToken(TokenHandle, (TOKEN_INFORMATION_CLASS)TokenIsRestricted, &restricted, sizeof(ULONG), &returnLength))) { + m_ProcessInfo.IsRestricted = !!restricted; + } + + BYTE appContainerBuffer[0x80]; + if (NT_SUCCESS(NtQueryInformationToken(TokenHandle, (TOKEN_INFORMATION_CLASS)TokenAppContainerSid, appContainerBuffer, sizeof(appContainerBuffer), &returnLength))) { + PTOKEN_APPCONTAINER_INFORMATION appContainerInfo = (PTOKEN_APPCONTAINER_INFORMATION)appContainerBuffer; + m_ProcessInfo.IsAppContainer = appContainerInfo->TokenAppContainer != NULL; + } + CloseHandle(TokenHandle); } } diff --git a/SandboxiePlus/SandMan/SbieProcess.h b/SandboxiePlus/SandMan/SbieProcess.h index ac45cc76..fe2dd9b9 100644 --- a/SandboxiePlus/SandMan/SbieProcess.h +++ b/SandboxiePlus/SandMan/SbieProcess.h @@ -29,6 +29,8 @@ public: virtual bool HasElevatedToken() { return m_ProcessInfo.IsElevated; } virtual bool HasSystemToken() { return m_ProcessInfo.IsSystem; } + virtual bool HasRestrictedToken() { return m_ProcessInfo.IsRestricted; } + virtual bool HasAppContainerToken() { return m_ProcessInfo.IsAppContainer; } protected: @@ -45,7 +47,9 @@ protected: quint32 IsElevated : 1, IsSystem : 1, - Spare : 30; + IsRestricted : 1, + IsAppContainer : 1, + Spare : 28; }; } m_ProcessInfo; }; \ No newline at end of file