diff --git a/CHANGELOG.md b/CHANGELOG.md index 38747e0e..0ab74bfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). - added option to prevent sandboxed processes from accessing the images of the window outside the sandbox [#1985](https://github.com/sandboxie-plus/Sandboxie/issues/1985) (thanks Yeyixiao) - it can be enabled with "IsBlockCapture=y" - see the sandbox option "Prevent sandboxed processes from using public methods to capture window images" in SandMan UI +- added "LingerExemptWnds=n" to make the lingering process monitor mechanism no longer exempt lingering processes with windows from termination + +### Changed +- option "LingerLeniency=n" now also disabled the 5 sec grace period for freshly started lingerers [#1892](https://github.com/sandboxie-plus/Sandboxie/issues/1892) ### Fixed - fixed issue with symlinks related to startmenu folders diff --git a/Sandboxie/apps/com/RpcSs/linger.c b/Sandboxie/apps/com/RpcSs/linger.c index abd80bc5..bd5e2dc4 100644 --- a/Sandboxie/apps/com/RpcSs/linger.c +++ b/Sandboxie/apps/com/RpcSs/linger.c @@ -538,7 +538,7 @@ int DoLingerLeader(void) // don't terminate if a lingering process has an open window // - if (terminate_and_stop) { + if (terminate_and_stop && SbieApi_QueryConfBool(NULL, L"LingerExemptWnds", TRUE)) { // // if a process in the PID list has a window LingerEnumWindowsProc will return FALSE @@ -554,7 +554,7 @@ int DoLingerLeader(void) // don't terminate if a lingering process has just started recently // - if (terminate_and_stop) { + if (terminate_and_stop && SbieApi_QueryConfBool(NULL, L"LingerLeniency", TRUE)) { for (i = 0; i < process_count; ++i) { HANDLE hProcess = NULL; ULONG64 ProcessFlags = SbieApi_QueryProcessInfo( diff --git a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui index 43c20cb8..d83d841b 100644 --- a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui @@ -2076,7 +2076,7 @@ - 0 + 2 @@ -2097,33 +2097,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Remove - - - - - - - Show Templates - - - @@ -2143,6 +2116,13 @@ + + + + Show Templates + + + @@ -2153,6 +2133,26 @@ + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -2236,6 +2236,73 @@ + + + Stop Options + + + + + + + + + true + true + + + + Stop Behavioure + + + + + + + Use Linger Leniency + + + + + + + + + + Don't stop lingering processes with windows + + + + + + + Qt::Horizontal + + + + 40 + 0 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + diff --git a/SandboxiePlus/SandMan/Windows/OptionsStop.cpp b/SandboxiePlus/SandMan/Windows/OptionsStop.cpp index 85d30f16..3e7693d5 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsStop.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsStop.cpp @@ -25,6 +25,9 @@ void COptionsWindow::LoadStop() AddLeaderEntry(Value, true); LoadLeaderTmpl(); + ui.chkNoStopWnd->setChecked(m_pBox->GetBool("LingerExemptWnds", true)); + ui.chkLingerLeniency->setChecked(m_pBox->GetBool("LingerLeniency", true)); + m_StopChanged = false; } @@ -134,6 +137,9 @@ void COptionsWindow::SaveStop() WriteTextList("LeaderProcess", LeaderProcess); WriteTextList("LeaderProcessDisabled", LeaderProcessDisabled); + WriteAdvancedCheck(ui.chkNoStopWnd, "LingerExemptWnds", "", "n"); + WriteAdvancedCheck(ui.chkLingerLeniency, "LingerLeniency", "", "n"); + m_StopChanged = false; } diff --git a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp index 51c227b4..9943a47f 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp @@ -222,6 +222,7 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri ui.tabsStop->setCurrentIndex(0); ui.tabsStop->setTabIcon(0, CSandMan::GetIcon("Fail")); ui.tabsStop->setTabIcon(1, CSandMan::GetIcon("Pass")); + ui.tabsStop->setTabIcon(2, CSandMan::GetIcon("Policy")); ui.tabsInternet->setCurrentIndex(0); ui.tabsInternet->setTabIcon(0, CSandMan::GetIcon("Program")); @@ -306,6 +307,13 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri QWidget* pWidget2 = new QWidget(); pWidget2->setLayout(ui.gridLayout_61); ui.gridLayout_17->addWidget(pWidget2, 2, 0); + QWidget* pWidget3 = new QWidget(); + pWidget3->setLayout(ui.gridLayout_82); + ui.gridLayout_82->setContentsMargins(3, 3, 3, 3); + ui.verticalSpacer_40->changeSize(0, 0); + ui.lblStopOpt->setVisible(false); + ui.lblStopOpt->setProperty("hidden", true); + ui.gridLayout_17->addWidget(pWidget3, 3, 0); delete ui.tabsStop; ui.gridLayout_17->setContentsMargins(0, 0, 0, 0); @@ -364,6 +372,8 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri AddIconToLabel(ui.lblPrinting, CSandMan::GetIcon("Printer").pixmap(size,size)); AddIconToLabel(ui.lblOther, CSandMan::GetIcon("NoAccess").pixmap(size,size)); + AddIconToLabel(ui.lblStopOpt, CSandMan::GetIcon("Stop").pixmap(size,size)); + AddIconToLabel(ui.lblMode, CSandMan::GetIcon("Anon").pixmap(size,size)); AddIconToLabel(ui.lblPolicy, CSandMan::GetIcon("Policy").pixmap(size,size)); @@ -476,13 +486,16 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri connect(ui.btnDelStopProg, SIGNAL(clicked(bool)), this, SLOT(OnDelStopProg())); connect(ui.chkShowStopTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowStopTmpl())); ui.treeStop->setItemDelegateForColumn(0, new ProgramsDelegate(this, ui.treeStop, -1, this)); - connect(ui.treeStop, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnStopChanged(QTreeWidgetItem *, int))); + connect(ui.treeStop, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnStopChanged())); connect(ui.btnAddLeader, SIGNAL(clicked(bool)), this, SLOT(OnAddLeader())); connect(ui.btnDelLeader, SIGNAL(clicked(bool)), this, SLOT(OnDelLeader())); connect(ui.chkShowLeaderTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowLeaderTmpl())); ui.treeLeader->setItemDelegateForColumn(0, new ProgramsDelegate(this, ui.treeLeader, -1, this)); - connect(ui.treeLeader, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnStopChanged(QTreeWidgetItem *, int))); + connect(ui.treeLeader, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnStopChanged())); + + connect(ui.chkNoStopWnd, SIGNAL(clicked(bool)), this, SLOT(OnStopChanged())); + connect(ui.chkLingerLeniency, SIGNAL(clicked(bool)), this, SLOT(OnStopChanged())); // // Start diff --git a/SandboxiePlus/SandMan/Windows/OptionsWindow.h b/SandboxiePlus/SandMan/Windows/OptionsWindow.h index bd0b223a..5bb9acee 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsWindow.h +++ b/SandboxiePlus/SandMan/Windows/OptionsWindow.h @@ -101,7 +101,7 @@ private slots: void OnAddLingering(); void OnDelStopProg(); void OnShowStopTmpl() { LoadStopTmpl(true); } - void OnStopChanged(QTreeWidgetItem* pItem, int Index) { m_StopChanged = true; OnOptChanged(); } + void OnStopChanged() { m_StopChanged = true; OnOptChanged(); } void OnAddLeader(); void OnDelLeader(); void OnShowLeaderTmpl() { LoadLeaderTmpl(true); } diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index cf759a01..9c378e43 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -49,6 +49,7 @@ void FixTriStateBoxPallete(QWidget* pWidget) void AddIconToLabel(QLabel* pLabel, const QPixmap& Pixmap) { + if (pLabel->property("hidden").toBool()) return; QWidget* pParent = pLabel->parentWidget(); QWidget* pWidget = new QWidget(pParent); pParent->layout()->replaceWidget(pLabel, pWidget); @@ -480,6 +481,7 @@ CSettingsWindow::CSettingsWindow(QWidget* parent) connect(ui.lblSupport, SIGNAL(linkActivated(const QString&)), theGUI, SLOT(OpenUrl(const QString&))); connect(ui.lblSupportCert, SIGNAL(linkActivated(const QString&)), theGUI, SLOT(OpenUrl(const QString&))); connect(ui.lblCertExp, SIGNAL(linkActivated(const QString&)), theGUI, SLOT(OpenUrl(const QString&))); + connect(ui.lblCertGuide, SIGNAL(linkActivated(const QString&)), theGUI, SLOT(OpenUrl(const QString&))); connect(ui.lblInsiderInfo, SIGNAL(linkActivated(const QString&)), theGUI, SLOT(OpenUrl(const QString&))); m_CertChanged = false; @@ -925,7 +927,7 @@ void CSettingsWindow::LoadSettings() ui.keyPauseForce->setKeySequence(QKeySequence(theConf->GetString("Options/PauseForceKeySequence", "Ctrl+Alt+F"))); ui.chkSuspend->setChecked(theConf->GetBool("Options/EnableSuspendKey", false)); - ui.keySuspend->setKeySequence(QKeySequence(theConf->GetString("Options/SuspendKeySequence", "Ctrl+Pause"))); + ui.keySuspend->setKeySequence(QKeySequence(theConf->GetString("Options/SuspendKeySequence", "Shift+Alt+Pause"))); ui.chkMonitorSize->setChecked(theConf->GetBool("Options/WatchBoxSize", false)); @@ -1664,7 +1666,6 @@ void CSettingsWindow::SaveSettings() WriteAdvancedCheck(ui.chkAdminOnlyFP, "ForceDisableAdminOnly", "y", ""); WriteAdvancedCheck(ui.chkClearPass, "ForgetPassword", "y", ""); - } if (m_WarnProgsChanged)