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 00000000..5cb3e740 Binary files /dev/null and b/SandboxiePlus/SandMan/Resources/Actions/AppContainer.png differ diff --git a/SandboxiePlus/SandMan/Resources/Actions/Restricted.png b/SandboxiePlus/SandMan/Resources/Actions/Restricted.png new file mode 100644 index 00000000..740511d5 Binary files /dev/null and b/SandboxiePlus/SandMan/Resources/Actions/Restricted.png differ diff --git a/SandboxiePlus/SandMan/Resources/SandMan.qrc b/SandboxiePlus/SandMan/Resources/SandMan.qrc index 85ca23d0..fa36711e 100644 --- a/SandboxiePlus/SandMan/Resources/SandMan.qrc +++ b/SandboxiePlus/SandMan/Resources/SandMan.qrc @@ -145,6 +145,8 @@ Actions/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