& BoxList, cons
pNode->inUse = inUse;
pNode->boxType = boxType;
//pNode->Icon = pNode->inUse ? m_BoxInUse : m_BoxEmpty;
- pNode->Icon = theGUI->GetBoxIcon(inUse, boxType);
+ pNode->Icon = theGUI->GetBoxIcon(boxType, inUse);
Changed = 1; // set change for first column
}
diff --git a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-b-empty.png b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-b-empty.png
index 5a0d03af..6cb88c59 100644
Binary files a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-b-empty.png and b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-b-empty.png differ
diff --git a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-b-full.png b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-b-full.png
index e3a27335..0fea5cc3 100644
Binary files a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-b-full.png and b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-b-full.png differ
diff --git a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-c-empty.png b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-c-empty.png
index d23c6b75..1da9f210 100644
Binary files a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-c-empty.png and b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-c-empty.png differ
diff --git a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-c-full.png b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-c-full.png
index 2a60113a..133d8278 100644
Binary files a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-c-full.png and b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-c-full.png differ
diff --git a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-r-empty.png b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-r-empty.png
index 9b229cdf..d457977f 100644
Binary files a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-r-empty.png and b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-r-empty.png differ
diff --git a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-r-full.png b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-r-full.png
index f5321110..a9538854 100644
Binary files a/SandboxiePlus/SandMan/Resources/Boxes/sandbox-r-full.png and b/SandboxiePlus/SandMan/Resources/Boxes/sandbox-r-full.png differ
diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp
index 5d3b2684..6013a31f 100644
--- a/SandboxiePlus/SandMan/SandMan.cpp
+++ b/SandboxiePlus/SandMan/SandMan.cpp
@@ -494,7 +494,7 @@ void CSandMan::CreateToolBar()
m_pToolBar->addSeparator();
m_pToolBar->addWidget(new QLabel(" "));
- QLabel* pSupportLbl = new QLabel(tr("Support Sandboxie-Plus on Patreon"));
+ QLabel* pSupportLbl = new QLabel("Support Sandboxie-Plus on Patreon");
pSupportLbl->setTextInteractionFlags(Qt::TextBrowserInteraction);
connect(pSupportLbl, SIGNAL(linkActivated(const QString&)), this, SLOT(OnHelp()));
m_pToolBar->addWidget(pSupportLbl);
@@ -565,17 +565,46 @@ void CSandMan::closeEvent(QCloseEvent *e)
QApplication::quit();
}
-QIcon CSandMan::GetBoxIcon(bool inUse, int boxType)
+QIcon CSandMan::GetBoxIcon(int boxType, bool inUse)
{
EBoxColors color = eYellow;
switch (boxType) {
- case CSandBoxPlus::eHardened: color = eOrang; break;
- //case CSandBoxPlus::eHasLogApi: color = eRed; break;
- case CSandBoxPlus::eInsecure: color = eMagenta; break;
+ case CSandBoxPlus::eHardenedPlus: color = eRed; break;
+ case CSandBoxPlus::eHardened: color = eOrang; break;
+ case CSandBoxPlus::eDefaultPlus: color = eBlue; break;
+ case CSandBoxPlus::eDefault: color = eYellow; break;
+ case CSandBoxPlus::eAppBoxPlus: color = eCyan; break;
+ case CSandBoxPlus::eAppBox: color = eGreen; break;
+ case CSandBoxPlus::eInsecure: color = eMagenta; break;
}
return inUse ? m_BoxIcons[color].second : m_BoxIcons[color].first;
}
+QString CSandMan::GetBoxDescription(int boxType)
+{
+ QString Info;
+
+ switch (boxType) {
+ case CSandBoxPlus::eHardenedPlus:
+ case CSandBoxPlus::eHardened:
+ Info = tr("This box provides enhanced security isolation, it is suitable to test untrusted software.");
+ break;
+ case CSandBoxPlus::eDefaultPlus:
+ case CSandBoxPlus::eDefault:
+ Info = tr("This box provides standard isolation, it is suitable to run your software to enhance security.");
+ break;
+ case CSandBoxPlus::eAppBoxPlus:
+ case CSandBoxPlus::eAppBox:
+ Info = tr("This box does not enforce isolation, it is intended to be used as an application compartment for software virtualization only.");
+ break;
+ }
+
+ if(boxType == CSandBoxPlus::eHardenedPlus || boxType == CSandBoxPlus::eDefaultPlus || boxType == CSandBoxPlus::eAppBoxPlus)
+ Info.append(tr("\n\nThis box prevents access to all user data locations, except explicitly granted in the Resource Access options."));
+
+ return Info;
+}
+
bool CSandMan::IsFullyPortable()
{
QString SbiePath = theAPI->GetSbiePath();
@@ -945,6 +974,10 @@ void CSandMan::OnStatusChanged()
g_FeatureFlags = theAPI->GetFeatureFlags();
+ // if teh certificate is valid but the driver does not report it being active it means its expired
+ if (!g_Certificate.isEmpty() && (g_FeatureFlags & CSbieAPI::eSbieFeatureCert) == 0) {
+ OnLogMessage(tr("The supporter certificate is expired"));
+ }
SB_STATUS Status = theAPI->ReloadBoxes();
@@ -1024,7 +1057,7 @@ void CSandMan::SetupHotKeys()
m_pHotkeyManager->unregisterAllHotkeys();
if (theConf->GetBool("Options/EnablePanicKey", false))
- m_pHotkeyManager->registerHotkey(theConf->GetString("Options/PanicKeySequence", "Shift+Pause"), HK_PANIC);
+ m_pHotkeyManager->registerHotkey(theConf->GetString("Options/PanicKeySequence", "Ctrl+Alt+Cancel"), HK_PANIC);
}
void CSandMan::OnHotKey(size_t id)
@@ -1066,6 +1099,30 @@ void CSandMan::OnLogSbieMessage(quint32 MsgCode, const QStringList& MsgData, qui
m_MissingTemplates.append(MsgData[2]);
}
+ if ((MsgCode & 0xFFFF) == 6004) // certificat error
+ {
+ static bool bCertWarning = false;
+ if (!bCertWarning) {
+ bCertWarning = true;
+
+ QMessageBox msgBox;
+ msgBox.setTextFormat(Qt::RichText);
+ msgBox.setIcon(QMessageBox::Critical);
+ msgBox.setWindowTitle("Sandboxie-Plus");
+ msgBox.setText( tr("The program %1 started in box %2 will be terminated in 5 minutes because the box was configured to use features exclusively available to project supporters.
"
+ "Become a project supporter, and receive a supporter certificate").arg(MsgData[2]).arg(MsgData[1]));
+ msgBox.setStandardButtons(QMessageBox::Ok);
+ msgBox.exec();
+ /*msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ if (msgBox.exec() == QDialogButtonBox::Yes) {
+ OpenUrl(QUrl("https://sandboxie-plus.com/go.php?to=sbie-get-cert"));
+ }*/
+
+ //bCertWarning = false;
+ }
+ // return;
+ }
+
QString Message = MsgCode != 0 ? theAPI->GetSbieMsgStr(MsgCode, m_LanguageId) : (MsgData.size() > 0 ? MsgData[0] : QString());
for (int i = 1; i < MsgData.size(); i++)
@@ -1086,6 +1143,32 @@ void CSandMan::OnLogSbieMessage(quint32 MsgCode, const QStringList& MsgData, qui
m_pPopUpWindow->AddLogMessage(Message, MsgCode, MsgData, ProcessId);
}
+bool CSandMan::CheckCertificate()
+{
+ if (!g_Certificate.isEmpty())
+ return true;
+
+ //if ((g_FeatureFlags & CSbieAPI::eSbieFeatureCert) == 0) {
+ // OnLogMessage(tr("The supporter certificate is expired"));
+ // return false;
+ //}
+
+ QMessageBox msgBox;
+ msgBox.setTextFormat(Qt::RichText);
+ msgBox.setIcon(QMessageBox::Information);
+ msgBox.setWindowTitle("Sandboxie-Plus");
+ msgBox.setText(tr("The selected feature set is only available to project supporters. Processes started in a box with this feature set enabled without a supporter certificate will be terminated after 5 minutes.
"
+ "Become a project supporter, and receive a supporter certificate"));
+ msgBox.setStandardButtons(QMessageBox::Ok);
+ msgBox.exec();
+ /*msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ if (msgBox.exec() == QDialogButtonBox::Yes) {
+ OpenUrl(QUrl("https://sandboxie-plus.com/go.php?to=sbie-get-cert"));
+ }*/
+
+ return false;
+}
+
void CSandMan::OnQueuedRequest(quint32 ClientPid, quint32 ClientTid, quint32 RequestId, const QVariantMap& Data)
{
m_pPopUpWindow->AddUserPrompt(RequestId, Data, ClientPid);
@@ -1809,7 +1892,7 @@ void CSandMan::OnSysTray(QSystemTrayIcon::ActivationReason Reason)
bAdded = true;
}
- pItem->setData(0, Qt::DecorationRole, theGUI->GetBoxIcon(pBox->GetActiveProcessCount() != 0, pBoxEx->GetType()));
+ pItem->setData(0, Qt::DecorationRole, theGUI->GetBoxIcon(pBoxEx->GetType(), pBox->GetActiveProcessCount() != 0));
}
foreach(QTreeWidgetItem* pItem, OldBoxes)
@@ -1936,7 +2019,10 @@ void CSandMan::CheckForUpdates(bool bManual)
Query.addQueryItem("version", QString::number(VERSION_MJR) + "." + QString::number(VERSION_MIN) + "." + QString::number(VERSION_REV) + "." + QString::number(VERSION_UPD));
Query.addQueryItem("system", "windows-" + QSysInfo::kernelVersion() + "-" + QSysInfo::currentCpuArchitecture());
Query.addQueryItem("language", QString::number(m_LanguageId));
- QString UpdateKey = theAPI->GetGlobalSettings()->GetText("UpdateKey"); // theConf->GetString("Options/UpdateKey");
+
+ QString UpdateKey = GetArguments(g_Certificate, L'\n', L':').value("updatekey");
+ if (UpdateKey.isEmpty())
+ UpdateKey = theAPI->GetGlobalSettings()->GetText("UpdateKey"); // theConf->GetString("Options/UpdateKey");
if (!UpdateKey.isEmpty())
Query.addQueryItem("update_key", UpdateKey);
Query.addQueryItem("auto", bManual ? "0" : "1");
@@ -2169,16 +2255,26 @@ void CSandMan::OnAbout()
"Version %1
"
"Copyright (c) 2020-2021 by DavidXanatos
"
).arg(GetVersion());
+
+ QString CertInfo;
+ if (!g_Certificate.isEmpty()) {
+ CertInfo = tr("This copy of Sandboxie+ is certified for: %1").arg(GetArguments(g_Certificate, L'\n', L':').value("name"));
+ } else {
+ CertInfo = tr("Sandboxie+ is free for personal and non-commercial use.");
+ }
+
QString AboutText = tr(
- "Sandboxie-Plus is an open source continuation of Sandboxie.
"
- ""
- "Visit sandboxie-plus.com for more information.
"
- ""
- ""
- ""
- "Icons from icons8.com
"
- ""
- );
+ "Sandboxie-Plus is an open source continuation of Sandboxie."
+ "Visit sandboxie-plus.com for more information.
"
+ "
"
+ "%3
"
+ "
"
+ "Driver version: %1
"
+ "Features: %2
"
+ "
"
+ "Icons from icons8.com"
+ ).arg(theAPI->GetVersion()).arg(theAPI->GetFeatureStr()).arg(CertInfo);
+
QMessageBox *msgBox = new QMessageBox(this);
msgBox->setAttribute(Qt::WA_DeleteOnClose);
msgBox->setWindowTitle(tr("About Sandboxie-Plus"));
@@ -2301,14 +2397,6 @@ QT_TRANSLATE_NOOP("QPlatformTheme", "&Yes"),
QT_TRANSLATE_NOOP("QPlatformTheme", "&No"),
};
-// Make sure that CSandBox strings won't be marked as vanished in all .ts files, even after running lupdate
-
-static const char* CSandBox_strings[] = {
-QT_TRANSLATE_NOOP("CSandBox", "Waiting for folder: %1"),
-QT_TRANSLATE_NOOP("CSandBox", "Deleting folder: %1"),
-QT_TRANSLATE_NOOP("CSandBox", "Merging folders: %1 >> %2"),
-QT_TRANSLATE_NOOP("CSandBox", "Finishing Snapshot Merge..."),
-};
//////////////////////////////////////////////////////////////////////////////////////////
// WinSpy based window finder
diff --git a/SandboxiePlus/SandMan/SandMan.h b/SandboxiePlus/SandMan/SandMan.h
index a9891431..425fa9c5 100644
--- a/SandboxiePlus/SandMan/SandMan.h
+++ b/SandboxiePlus/SandMan/SandMan.h
@@ -52,7 +52,7 @@ public:
void RunSandboxed(const QStringList& Commands, const QString& BoxName);
- QIcon GetBoxIcon(bool inUse, int boxType = 0);
+ QIcon GetBoxIcon(int boxType, bool inUse = false);
QString GetBoxDescription(int boxType);
bool CheckCertificate();
diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.cpp b/SandboxiePlus/SandMan/SbiePlusAPI.cpp
index 177bd198..2f6e10f4 100644
--- a/SandboxiePlus/SandMan/SbiePlusAPI.cpp
+++ b/SandboxiePlus/SandMan/SbiePlusAPI.cpp
@@ -86,7 +86,9 @@ CSandBoxPlus::CSandBoxPlus(const QString& BoxName, class CSbieAPI* pAPI) : CSand
m_bDropRights = false;
- m_bSecurityRestricted = false;
+ m_bSecurityEnhanced = false;
+ m_bPrivacyEnhanced = false;
+ m_bApplicationCompartment = false;
m_iUnsecureDebugging = 0;
m_SuspendRecovery = false;
@@ -142,7 +144,9 @@ void CSandBoxPlus::UpdateDetails()
//GetBool("SandboxieLogon", false)
- m_bSecurityRestricted = m_iUnsecureDebugging == 0 && (GetBool("DropAdminRights", false));
+ m_bSecurityEnhanced = m_iUnsecureDebugging == 0 && (GetBool("DropAdminRights", false));
+ m_bApplicationCompartment = GetBool("NoSecurityIsolation", false);
+ m_bPrivacyEnhanced = (m_iUnsecureDebugging != 1 || m_bApplicationCompartment) && (GetBool("UsePrivacyMode", false)); // app compartments are inhenrently insecure
CSandBox::UpdateDetails();
}
@@ -154,37 +158,6 @@ void CSandBoxPlus::CloseBox()
m_SuspendRecovery = false;
}
-QString CSandBoxPlus::GetStatusStr() const
-{
- if (!m_IsEnabled)
- return tr("Disabled");
-
- QStringList Status;
-
- if (IsEmpty())
- Status.append(tr("Empty"));
-
- if (m_iUnsecureDebugging == 1)
- Status.append(tr("NOT SECURE (Debug Config)"));
- else if (m_iUnsecureDebugging == 2)
- Status.append(tr("Reduced Isolation"));
- else if(m_bSecurityRestricted)
- Status.append(tr("Enhanced Isolation"));
-
- if (m_bLogApiFound)
- Status.append(tr("API Log"));
- if (m_bINetBlocked)
- Status.append(tr("No INet"));
- if (m_bSharesAllowed)
- Status.append(tr("Net Share"));
- if (m_bDropRights)
- Status.append(tr("No Admin"));
-
- if (Status.isEmpty())
- return tr("Normal");
- return Status.join(", ");
-}
-
bool CSandBoxPlus::CheckUnsecureConfig() const
{
if (GetBool("OriginalToken", false)) return true;
@@ -195,10 +168,68 @@ bool CSandBoxPlus::CheckUnsecureConfig() const
if(GetBool("UnfilteredToken", false)) return true;
if (GetBool("DisableFileFilter", false)) return true;
if (GetBool("DisableKeyFilter", false)) return true;
+ if (GetBool("DisableObjectFilter", false)) return true;
+
if (GetBool("StripSystemPrivileges", false)) return true;
return false;
}
+QString CSandBoxPlus::GetStatusStr() const
+{
+ if (!m_IsEnabled)
+ return tr("Disabled");
+
+ QStringList Status;
+
+ if (IsEmpty())
+ Status.append(tr("Empty"));
+
+ if (m_bApplicationCompartment)
+ Status.append(tr("Application Compartment"));
+ else if (m_iUnsecureDebugging == 1)
+ Status.append(tr("NOT SECURE"));
+ else if (m_iUnsecureDebugging == 2)
+ Status.append(tr("Reduced Isolation"));
+ else if(m_bSecurityEnhanced)
+ Status.append(tr("Enhanced Isolation"));
+
+ if(m_bPrivacyEnhanced)
+ Status.append(tr("Privacy Enhanced"));
+
+ if (m_bLogApiFound)
+ Status.append(tr("API Log"));
+ if (m_bINetBlocked)
+ Status.append(tr("No INet"));
+ if (m_bSharesAllowed)
+ Status.append(tr("Net Share"));
+ if (m_bDropRights && !m_bSecurityEnhanced)
+ Status.append(tr("No Admin"));
+
+ if (Status.isEmpty())
+ return tr("Normal");
+ return Status.join(", ");
+}
+
+CSandBoxPlus::EBoxTypes CSandBoxPlus::GetType() const
+{
+ if (m_bApplicationCompartment && m_bPrivacyEnhanced)
+ return eAppBoxPlus;
+ if (m_bApplicationCompartment)
+ return eAppBox;
+
+ if (m_iUnsecureDebugging != 0)
+ return eInsecure;
+
+ if (m_bSecurityEnhanced && m_bPrivacyEnhanced)
+ return eHardenedPlus;
+ if (m_bSecurityEnhanced)
+ return eHardened;
+
+ if (m_bPrivacyEnhanced)
+ return eDefaultPlus;
+ return eDefault;
+}
+
void CSandBoxPlus::SetLogApi(bool bEnable)
{
if (bEnable)
@@ -389,17 +420,6 @@ int CSandBoxPlus::IsLeaderProgram(const QString& ProgName)
return FindInStrList(Programs, ProgName) != Programs.end() ? 1 : 0;
}
-CSandBoxPlus::EBoxTypes CSandBoxPlus::GetType() const
-{
- //if (m_bLogApiFound)
- // return eHasLogApi;
- if (m_iUnsecureDebugging != 0)
- return eInsecure;
- if (m_bSecurityRestricted)
- return eHardened;
- return eDefault;
-}
-
///////////////////////////////////////////////////////////////////////////////
// CSbieProcess
//
diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.h b/SandboxiePlus/SandMan/SbiePlusAPI.h
index b6057a00..ca661cce 100644
--- a/SandboxiePlus/SandMan/SbiePlusAPI.h
+++ b/SandboxiePlus/SandMan/SbiePlusAPI.h
@@ -54,7 +54,6 @@ public:
virtual void SetDropRights(bool bEnable);
virtual bool IsDropRights() const { return m_bDropRights; }
- virtual bool IsSecurityRestricted() const { return m_bSecurityRestricted; }
virtual bool IsUnsecureDebugging() const { return m_iUnsecureDebugging != 0; }
virtual void BlockProgram(const QString& ProgName);
@@ -74,12 +73,15 @@ public:
enum EBoxTypes
{
- eDefault = 0,
+ eHardenedPlus,
eHardened,
- //eHasLogApi,
+ eDefaultPlus,
+ eDefault,
+ eAppBoxPlus,
+ eAppBox,
eInsecure,
- eUnknown = -1
+ eUnknown
};
EBoxTypes GetType() const;
@@ -99,12 +101,15 @@ protected:
bool m_bSharesAllowed;
bool m_bDropRights;
- bool m_bSecurityRestricted;
+ bool m_bSecurityEnhanced;
+ bool m_bPrivacyEnhanced;
+ bool m_bApplicationCompartment;
int m_iUnsecureDebugging;
bool m_SuspendRecovery;
QSet m_RecentPrograms;
+
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp
index 2827d2e9..098ed94a 100644
--- a/SandboxiePlus/SandMan/Views/SbieView.cpp
+++ b/SandboxiePlus/SandMan/Views/SbieView.cpp
@@ -126,6 +126,7 @@ CSbieView::CSbieView(QWidget* parent) : CPanelView(parent)
m_pMenuPresetsShares = m_pMenuPresets->addAction(tr("Allow Network Shares"), this, SLOT(OnSandBoxAction()));
m_pMenuPresetsShares->setCheckable(true);
+ m_pMenuDuplicate = m_pMenu->addAction(CSandMan::GetIcon("Duplicate"), tr("Duplicate Sandbox"), this, SLOT(OnSandBoxAction()));
m_pMenuRename = m_pMenu->addAction(CSandMan::GetIcon("Rename"), tr("Rename Sandbox"), this, SLOT(OnSandBoxAction()));
m_iMoveTo = m_pMenu->actions().count();
m_pMenuMoveTo = m_pMenu->addMenu(CSandMan::GetIcon("Group"), tr("Move Box/Group"));
@@ -356,6 +357,7 @@ void CSbieView::UpdateMenu()
UpdateRunMenu(pBox);
m_pMenuMkLink->setEnabled(iSandBoxeCount == 1);
+ m_pMenuDuplicate->setEnabled(iSandBoxeCount == 1);
m_pMenuRename->setEnabled(iSandBoxeCount == 1);
m_pMenuRecover->setEnabled(iSandBoxeCount == 1);
@@ -875,6 +877,43 @@ void CSbieView::OnSandBoxAction(QAction* Action)
pSnapshotsWindow->show();
}
}
+ else if (Action == m_pMenuDuplicate)
+ {
+ QString OldValue = SandBoxes.first()->GetName().replace("_", " ");
+ QString Value = QInputDialog::getText(this, "Sandboxie-Plus", tr("Please enter a new name for the duplicated Sandbox."), QLineEdit::Normal, tr("%1 Copy").arg(OldValue));
+ if (Value.isEmpty() || Value == OldValue)
+ return;
+
+ QString Name = Value.replace(" ", "_");
+ SB_STATUS Status = theAPI->CreateBox(Name, false);
+
+ if (!Status.IsError())
+ {
+ CSandBoxPtr pBox = theAPI->GetBoxByName(Value);
+
+ QList> Settings;
+ CSandBoxPtr pSrcBox = theAPI->GetBoxByName(SandBoxes.first()->GetName());
+ qint32 status = 0;
+ if (!pSrcBox.isNull()) Settings = pSrcBox->GetIniSection(&status);
+ if (Settings.isEmpty())
+ Status = SB_ERR(SB_FailedCopyConf, QVariantList() << SandBoxes.first()->GetName() << (quint32)status);
+ else
+ {
+ for (QList>::iterator I = Settings.begin(); I != Settings.end(); ++I)
+ {
+ Status = theAPI->SbieIniSet(Name, I->first, I->second, CSbieAPI::eIniInsert, false);
+ if (Status.IsError())
+ break;
+ }
+ }
+
+ theAPI->CommitIniChanges();
+ theAPI->ReloadConfig();
+ theAPI->ReloadBoxes();
+ }
+
+ Results.append(Status);
+ }
else if (Action == m_pMenuRename)
{
QString OldValue = SandBoxes.first()->GetName().replace("_", " ");
diff --git a/SandboxiePlus/SandMan/Views/SbieView.h b/SandboxiePlus/SandMan/Views/SbieView.h
index be68eed6..8b2297be 100644
--- a/SandboxiePlus/SandMan/Views/SbieView.h
+++ b/SandboxiePlus/SandMan/Views/SbieView.h
@@ -116,6 +116,7 @@ private:
QAction* m_pMenuRecover;
QAction* m_pMenuCleanUp;
QAction* m_pMenuRemove;
+ QAction* m_pMenuDuplicate;
QAction* m_pMenuMoveUp;
//QAction* m_pMenuMoveBy;
QAction* m_pMenuMoveDown;
diff --git a/SandboxiePlus/SandMan/Views/TraceView.cpp b/SandboxiePlus/SandMan/Views/TraceView.cpp
index 393cc675..77bfd547 100644
--- a/SandboxiePlus/SandMan/Views/TraceView.cpp
+++ b/SandboxiePlus/SandMan/Views/TraceView.cpp
@@ -171,7 +171,7 @@ int CTraceView__Filter(const CTraceEntryPtr& pEntry, void* params)
if (This->m_FilterExp.isValid()) {
if (!pEntry->GetMessage().contains(This->m_FilterExp)
- //&& !pEntry->GetTypeStr().contains(This->m_FilterExp)
+ && !pEntry->GetTypeStr().contains(This->m_FilterExp)
//&& !pEntry->GetStautsStr().contains(This->m_FilterExp)
&& !pEntry->GetProcessName().contains(This->m_FilterExp))
Ret = This->m_bHighLight ? 1 : 0;
diff --git a/SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp b/SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp
index a0fdd446..5c3179ec 100644
--- a/SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp
+++ b/SandboxiePlus/SandMan/Windows/NewBoxWindow.cpp
@@ -35,19 +35,16 @@ CNewBoxWindow::CNewBoxWindow(QWidget *parent)
break;
}
- ui.cmbTemplates->addItem(tr("Hardened"));
- ui.cmbTemplates->addItem(tr("Default"));
- ui.cmbTemplates->setCurrentIndex(eDefault);
- ui.cmbTemplates->addItem(tr("Legacy Sandboxie Behaviour"));
- // leniant
- // open
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eHardenedPlus), tr("Hardened Sandbox with Data Protection"), (int)CSandBoxPlus::eHardenedPlus);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eHardened), tr("Security Hardened Sandbox"), (int)CSandBoxPlus::eHardened);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eDefaultPlus), tr("Sandbox with Data Protection"), (int)CSandBoxPlus::eDefaultPlus);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eDefault), tr("Standard Isolation Sandbox (Default)"), (int)CSandBoxPlus::eDefault);
+ //ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eInsecure), tr("UNSECURE Configuration (please change)"), (int)CSandBoxPlus::eInsecure);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eAppBoxPlus), tr("Application Compartment with Data Protection"), (int)CSandBoxPlus::eAppBoxPlus);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eAppBox), tr("Application Compartment (NO Isolation)"), (int)CSandBoxPlus::eAppBox);
- foreach(const CSandBoxPtr& pBox, Boxes)
- ui.cmbBoxes->addItem(pBox->GetName());
-
- connect(ui.radTemplate, SIGNAL(toggled(bool)), this, SLOT(OnPreset()));
- connect(ui.radCopy, SIGNAL(toggled(bool)), this, SLOT(OnPreset()));
- ui.radTemplate->setChecked(true);
+ connect(ui.cmbBoxType, SIGNAL(currentIndexChanged(int)), this, SLOT(OnBoxTypChanged()));
+ ui.cmbBoxType->setCurrentIndex(3); // default
ui.txtName->setFocus();
@@ -59,10 +56,14 @@ CNewBoxWindow::~CNewBoxWindow()
//theConf->SetBlob("NewBoxWindow/Window_Geometry", saveGeometry());
}
-void CNewBoxWindow::OnPreset()
+void CNewBoxWindow::OnBoxTypChanged()
{
- ui.cmbTemplates->setEnabled(ui.radTemplate->isChecked());
- ui.cmbBoxes->setEnabled(ui.radCopy->isChecked());
+ int BoxType = ui.cmbBoxType->currentData().toInt();
+
+ ui.lblBoxInfo->setText(theGUI->GetBoxDescription(BoxType));
+
+ if(BoxType != CSandBoxPlus::eDefault && BoxType != CSandBoxPlus::eHardened)
+ theGUI->CheckCertificate();
}
void CNewBoxWindow::CreateBox()
@@ -70,50 +71,36 @@ void CNewBoxWindow::CreateBox()
m_Name = ui.txtName->text();
m_Name.replace(" ", "_");
- bool bCopy = ui.radCopy->isChecked();
+ int BoxType = ui.cmbBoxType->currentData().toInt();
- SB_STATUS Status = theAPI->CreateBox(m_Name, !bCopy);
+ SB_STATUS Status = theAPI->CreateBox(m_Name, true);
if (!Status.IsError())
{
CSandBoxPtr pBox = theAPI->GetBoxByName(m_Name);
- if (bCopy)
+ switch (BoxType)
{
- QList> Settings;
- CSandBoxPtr pSrcBox = theAPI->GetBoxByName(ui.cmbBoxes->currentText());
- qint32 status = 0;
- if(!pSrcBox.isNull()) Settings = pSrcBox->GetIniSection(&status);
- if (Settings.isEmpty())
- Status = SB_ERR(SB_FailedCopyConf, QVariantList() << ui.cmbBoxes->currentText() << (quint32)status);
- else
- {
- for (QList>::iterator I = Settings.begin(); I != Settings.end(); ++I)
- {
- Status = theAPI->SbieIniSet(m_Name, I->first, I->second, CSbieAPI::eIniInsert);
- if (Status.IsError())
- break;
- }
- }
-
- theAPI->ReloadConfig();
- theAPI->ReloadBoxes();
- }
- else switch (ui.cmbTemplates->currentIndex())
- {
- case eHardened:
- pBox.objectCast()->SetBool("DropAdminRights", true);
- //pBox.objectCast()->SetBool("FakeAdminRights", true); // Note: making the app think it has admin rights has no security downsides, but it can help with compatibility
- pBox.objectCast()->SetBool("ClosePrintSpooler", true);
+ case CSandBoxPlus::eHardenedPlus:
+ case CSandBoxPlus::eHardened:
+ //pBox->SetBool("NoSecurityIsolation", false);
+ pBox->SetBool("DropAdminRights", true);
+ //pBox->SetBool("MsiInstallerExemptions", false);
+ pBox->SetBool("UsePrivacyMode", BoxType == CSandBoxPlus::eHardenedPlus);
break;
- case eLegacy:
- pBox.objectCast()->SetBool("UnrestrictedSCM", true);
- //pBox.objectCast()->SetBool("ExposeBoxedSystem", true);
- //pBox.objectCast()->SetBool("RunServicesAsSystem", true); // legacy behaviour, but there should be no normal use cases which require this
- pBox.objectCast()->SetBool("OpenPrintSpooler", true);
- pBox.objectCast()->InsertText("Template", "OpenSmartCard");
- default:
- pBox.objectCast()->InsertText("Template", "OpenBluetooth"); // most Unity games needs that, besides most modern games are Unity based
+ case CSandBoxPlus::eDefaultPlus:
+ case CSandBoxPlus::eDefault:
+ //pBox->SetBool("NoSecurityIsolation", false);
+ //pBox->SetBool("DropAdminRights", false);
+ //pBox->SetBool("MsiInstallerExemptions", false);
+ //pBox->SetBool("RunServicesAsSystem", false);
+ pBox->SetBool("UsePrivacyMode", BoxType == CSandBoxPlus::eDefaultPlus);
+ break;
+ case CSandBoxPlus::eAppBoxPlus:
+ case CSandBoxPlus::eAppBox:
+ pBox->SetBool("NoSecurityIsolation", true);
+ //pBox->SetBool("RunServicesAsSystem", true);
+ pBox->SetBool("UsePrivacyMode", BoxType == CSandBoxPlus::eAppBoxPlus);
break;
}
}
diff --git a/SandboxiePlus/SandMan/Windows/NewBoxWindow.h b/SandboxiePlus/SandMan/Windows/NewBoxWindow.h
index a7b9db4f..d72351b1 100644
--- a/SandboxiePlus/SandMan/Windows/NewBoxWindow.h
+++ b/SandboxiePlus/SandMan/Windows/NewBoxWindow.h
@@ -17,17 +17,7 @@ public:
private slots:
void CreateBox();
- void OnPreset();
-
-protected:
- enum ETemplates
- {
- eHardened = 0,
- eDefault,
- eLegacy,
- eLenient,
- eOpen
- };
+ void OnBoxTypChanged();
private:
Ui::NewBoxWindow ui;
diff --git a/SandboxiePlus/SandMan/Windows/OptionsAccess.cpp b/SandboxiePlus/SandMan/Windows/OptionsAccess.cpp
index 8c9c0dd5..69999eb5 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsAccess.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsAccess.cpp
@@ -11,6 +11,13 @@
void COptionsWindow::CreateAccess()
{
+ // Resource Access
+ connect(ui.chkPrivacy, SIGNAL(clicked(bool)), this, SLOT(OnAccessChanged()));
+ connect(ui.chkUseSpecificity, SIGNAL(clicked(bool)), this, SLOT(OnAccessChanged()));
+ connect(ui.chkCloseForBox, SIGNAL(clicked(bool)), this, SLOT(OnAccessChanged()));
+ connect(ui.chkNoOpenForBox, SIGNAL(clicked(bool)), this, SLOT(OnAccessChanged()));
+ //
+
connect(ui.btnAddFile, SIGNAL(clicked(bool)), this, SLOT(OnAddFile()));
QMenu* pFileBtnMenu = new QMenu(ui.btnAddFile);
pFileBtnMenu->addAction(tr("Browse for File"), this, SLOT(OnBrowseFile()));
@@ -21,9 +28,6 @@ void COptionsWindow::CreateAccess()
connect(ui.btnAddIPC, SIGNAL(clicked(bool)), this, SLOT(OnAddIPC()));
connect(ui.btnAddWnd, SIGNAL(clicked(bool)), this, SLOT(OnAddWnd()));
connect(ui.btnAddCOM, SIGNAL(clicked(bool)), this, SLOT(OnAddCOM()));
- // todo: add priority by order
- ui.btnMoveUp->setVisible(false);
- ui.btnMoveDown->setVisible(false);
connect(ui.chkShowAccessTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowAccessTmpl()));
connect(ui.btnDelAccess, SIGNAL(clicked(bool)), this, SLOT(OnDelAccess()));
@@ -32,6 +36,36 @@ void COptionsWindow::CreateAccess()
connect(ui.treeAccess, SIGNAL(itemSelectionChanged()), this, SLOT(OnAccessSelectionChanged()));
}
+void COptionsWindow::OnAccessChanged()
+{
+ if (ui.chkPrivacy->isChecked() || ui.chkUseSpecificity->isChecked())
+ theGUI->CheckCertificate();
+
+ UpdateAccessPolicy();
+
+ m_AccessChanged = true;
+ OnOptChanged();
+}
+
+void COptionsWindow::UpdateAccessPolicy()
+{
+ if (ui.chkPrivacy->isChecked()) {
+ ui.chkUseSpecificity->setEnabled(false);
+ ui.chkUseSpecificity->setChecked(true);
+
+ ui.chkCloseForBox->setEnabled(false);
+ ui.chkCloseForBox->setChecked(false);
+ ui.chkNoOpenForBox->setEnabled(false);
+ ui.chkNoOpenForBox->setChecked(false);
+ }
+ else {
+ ui.chkUseSpecificity->setEnabled(true);
+
+ ui.chkCloseForBox->setEnabled(true);
+ ui.chkNoOpenForBox->setEnabled(true);
+ }
+}
+
QTreeWidgetItem* COptionsWindow::GetAccessEntry(EAccessType Type, const QString& Program, EAccessMode Mode, const QString& Path)
{
for (int i = 0; i < ui.treeAccess->topLevelItemCount(); i++)
@@ -51,6 +85,7 @@ void COptionsWindow::SetAccessEntry(EAccessType Type, const QString& Program, EA
if (GetAccessEntry(Type, Program, Mode, Path) != NULL)
return; // already set
m_AccessChanged = true;
+ OnOptChanged();
AddAccessEntry(Type, Mode, Program, Path);
}
@@ -60,6 +95,7 @@ void COptionsWindow::DelAccessEntry(EAccessType Type, const QString& Program, EA
{
delete pItem;
m_AccessChanged = true;
+ OnOptChanged();
}
}
@@ -67,17 +103,21 @@ QString COptionsWindow::AccessTypeToName(EAccessEntry Type)
{
switch (Type)
{
+ case eNormalFilePath: return "NormalFilePath";
case eOpenFilePath: return "OpenFilePath";
case eOpenPipePath: return "OpenPipePath";
case eClosedFilePath: return "ClosedFilePath";
case eReadFilePath: return "ReadFilePath";
case eWriteFilePath: return "WriteFilePath";
+ case eNormalKeyPath: return "NormalKeyPath";
case eOpenKeyPath: return "OpenKeyPath";
+ case eOpenConfPath: return "OpenConfPath";
case eClosedKeyPath: return "ClosedKeyPath";
case eReadKeyPath: return "ReadKeyPath";
case eWriteKeyPath: return "WriteKeyPath";
+ case eNormalIpcPath: return "NormalIpcPath";
case eOpenIpcPath: return "OpenIpcPath";
case eClosedIpcPath: return "ClosedIpcPath";
@@ -92,7 +132,10 @@ QString COptionsWindow::AccessTypeToName(EAccessEntry Type)
void COptionsWindow::LoadAccessList()
{
+ ui.chkPrivacy->setChecked(m_pBox->GetBool("UsePrivacyMode", false));
+ ui.chkUseSpecificity->setChecked(m_pBox->GetBool("UseRuleSpecificity", false));
ui.chkCloseForBox->setChecked(m_pBox->GetBool("AlwaysCloseForBoxed", true));
+ ui.chkNoOpenForBox->setChecked(m_pBox->GetBool("DontOpenForBoxed", true));
ui.treeAccess->clear();
@@ -104,6 +147,8 @@ void COptionsWindow::LoadAccessList()
LoadAccessListTmpl();
+ UpdateAccessPolicy();
+
m_AccessChanged = false;
}
@@ -141,23 +186,27 @@ void COptionsWindow::ParseAndAddAccessEntry(EAccessEntry EntryType, const QStrin
EAccessMode Mode;
switch (EntryType)
{
- case eOpenFilePath: Type = eFile; Mode = eDirect; break;
- case eOpenPipePath: Type = eFile; Mode = eDirectAll; break;
+ case eNormalFilePath: Type = eFile; Mode = eNormal; break;
+ case eOpenFilePath: Type = eFile; Mode = eOpen; break;
+ case eOpenPipePath: Type = eFile; Mode = eOpen4All; break;
case eClosedFilePath: Type = eFile; Mode = eClosed; break;
case eReadFilePath: Type = eFile; Mode = eReadOnly; break;
case eWriteFilePath: Type = eFile; Mode = eWriteOnly; break;
- case eOpenKeyPath: Type = eKey; Mode = eDirect; break;
+ case eNormalKeyPath: Type = eKey; Mode = eNormal; break;
+ case eOpenKeyPath: Type = eKey; Mode = eOpen; break;
+ case eOpenConfPath: Type = eKey; Mode = eOpen4All;break;
case eClosedKeyPath: Type = eKey; Mode = eClosed; break;
case eReadKeyPath: Type = eKey; Mode = eReadOnly; break;
case eWriteKeyPath: Type = eKey; Mode = eWriteOnly; break;
- case eOpenIpcPath: Type = eIPC; Mode = eDirect; break;
+ case eNormalIpcPath: Type = eIPC; Mode = eNormal; break;
+ case eOpenIpcPath: Type = eIPC; Mode = eOpen; break;
case eClosedIpcPath: Type = eIPC; Mode = eClosed; break;
- case eOpenWinClass: Type = eWnd; Mode = eDirect; break;
+ case eOpenWinClass: Type = eWnd; Mode = eOpen; break;
- case eOpenCOM: Type = eCOM; Mode = eDirect; break;
+ case eOpenCOM: Type = eCOM; Mode = eOpen; break;
case eClosedCOM: Type = eCOM; Mode = eClosed; break;
case eClosedCOM_RT: Type = eCOM; Mode = eClosedRT; break;
@@ -184,12 +233,13 @@ QString COptionsWindow::GetAccessModeStr(EAccessMode Mode)
{
switch (Mode)
{
- case eDirect: return tr("Direct");
- case eDirectAll: return tr("Direct All");
+ case eNormal: return tr("Normal");
+ case eOpen: return tr("Open");
+ case eOpen4All: return tr("Open for All");
case eClosed: return tr("Closed");
case eClosedRT: return tr("Closed RT");
case eReadOnly: return tr("Read Only");
- case eWriteOnly: return tr("Hidden");
+ case eWriteOnly: return tr("Boxed Only");
}
return tr("Unknown");
}
@@ -213,9 +263,10 @@ void COptionsWindow::OnBrowseFile()
if (Value.isEmpty())
return;
- AddAccessEntry(eFile, eDirect, "", Value);
+ AddAccessEntry(eFile, eOpen, "", Value);
m_AccessChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnBrowseFolder()
@@ -224,9 +275,10 @@ void COptionsWindow::OnBrowseFolder()
if (Value.isEmpty())
return;
- AddAccessEntry(eFile, eDirect, "", Value);
+ AddAccessEntry(eFile, eOpen, "", Value);
m_AccessChanged = true;
+ OnOptChanged();
}
void COptionsWindow::AddAccessEntry(EAccessType Type, EAccessMode Mode, QString Program, const QString& Path, const QString& Template)
@@ -265,8 +317,9 @@ QString COptionsWindow::MakeAccessStr(EAccessType Type, EAccessMode Mode)
case eFile:
switch (Mode)
{
- case eDirect: return "OpenFilePath";
- case eDirectAll: return "OpenPipePath";
+ case eNormal: return "NormalFilePath";
+ case eOpen: return "OpenFilePath";
+ case eOpen4All: return "OpenPipePath";
case eClosed: return "ClosedFilePath";
case eReadOnly: return "ReadFilePath";
case eWriteOnly: return "WriteFilePath";
@@ -275,7 +328,9 @@ QString COptionsWindow::MakeAccessStr(EAccessType Type, EAccessMode Mode)
case eKey:
switch (Mode)
{
- case eDirect: return "OpenKeyPath";
+ case eNormal: return "NormalKeyPath";
+ case eOpen: return "OpenKeyPath";
+ case eOpen4All: return "OpenConfPath";
case eClosed: return "ClosedKeyPath";
case eReadOnly: return "ReadKeyPath";
case eWriteOnly: return "WriteKeyPath";
@@ -284,20 +339,21 @@ QString COptionsWindow::MakeAccessStr(EAccessType Type, EAccessMode Mode)
case eIPC:
switch (Mode)
{
- case eDirect: return "OpenIpcPath";
+ case eNormal: return "NormalIpcPath";
+ case eOpen: return "OpenIpcPath";
case eClosed: return "ClosedIpcPath";
}
break;
case eWnd:
switch (Mode)
{
- case eDirect: return "OpenWinClass";
+ case eOpen: return "OpenWinClass";
}
break;
case eCOM:
switch (Mode)
{
- case eDirect: return "OpenClsid";
+ case eOpen: return "OpenClsid";
case eClosed: return "ClosedClsid";
case eClosedRT: return "ClosedRT";
}
@@ -350,7 +406,7 @@ void COptionsWindow::CloseAccessEdit(QTreeWidgetItem* pItem, bool bSave)
bool isGUID = pPath->text().length() == 38 && pPath->text().left(1) == "{" && pPath->text().right(1) == "}";
switch (pMode->currentData().toInt())
{
- case eDirect:
+ case eOpen:
case eClosed:
if (!isGUID) {
QMessageBox::critical(this, "SandboxiePlus", tr("COM objects must be specified by their GUID, like: {00000000-0000-0000-0000-000000000000}"));
@@ -374,6 +430,7 @@ void COptionsWindow::CloseAccessEdit(QTreeWidgetItem* pItem, bool bSave)
pItem->setData(3, Qt::UserRole, pPath->text());
m_AccessChanged = true;
+ OnOptChanged();
}
ui.treeAccess->setItemWidget(pItem, 1, NULL);
@@ -385,11 +442,11 @@ QList COptionsWindow::GetAccessModes(EAccessType Ty
{
switch (Type)
{
- case eFile: return QList() << eDirect << eDirectAll << eClosed << eReadOnly << eWriteOnly;
- case eKey: return QList() << eDirect << eClosed << eReadOnly << eWriteOnly;
- case eIPC: return QList() << eDirect << eClosed;
- case eWnd: return QList() << eDirect;
- case eCOM: return QList() << eDirect << eClosed << eClosedRT;
+ case eFile: return QList() << eNormal << eOpen << eOpen4All << eClosed << eReadOnly << eWriteOnly;
+ case eKey: return QList() << eNormal << eOpen << eOpen4All << eClosed << eReadOnly << eWriteOnly;
+ case eIPC: return QList() << eNormal << eOpen << eClosed;
+ case eWnd: return QList() << eOpen;
+ case eCOM: return QList() << eOpen << eClosed << eClosedRT;
}
return QList();
}
@@ -424,9 +481,9 @@ void COptionsWindow::OnAccessItemDoubleClicked(QTreeWidgetItem* pItem, int Colum
QComboBox* pCombo = new QComboBox(pProgram);
pCombo->addItem(tr("All Programs"), "");
- for (int i = 0; i < ui.treeGroups->topLevelItemCount(); i++) {
- QTreeWidgetItem* pItem = ui.treeGroups->topLevelItem(i);
- pCombo->addItem(tr("Group: %1").arg(pItem->text(0)), pItem->data(0, Qt::UserRole).toString());
+ foreach(const QString Group, GetCurrentGroups()){
+ QString GroupName = Group.mid(1, Group.length() - 2);
+ pCombo->addItem(tr("Group: %1").arg(Group), GroupName);
}
foreach(const QString & Name, m_Programs)
@@ -469,18 +526,23 @@ void COptionsWindow::OnDelAccess()
{
DeleteAccessEntry(ui.treeAccess->currentItem());
m_AccessChanged = true;
+ OnOptChanged();
}
void COptionsWindow::SaveAccessList()
{
+ WriteAdvancedCheck(ui.chkPrivacy, "UsePrivacyMode", "y", "");
+ WriteAdvancedCheck(ui.chkUseSpecificity, "UseRuleSpecificity", "y", "");
WriteAdvancedCheck(ui.chkCloseForBox, "AlwaysCloseForBoxed", "", "n");
+ WriteAdvancedCheck(ui.chkNoOpenForBox, "DontOpenForBoxed", "", "n");
CloseAccessEdit(true);
- QStringList Keys = QStringList() << "OpenFilePath" << "OpenPipePath" << "ClosedFilePath" << "ReadFilePath" << "WriteFilePath"
- << "OpenKeyPath" << "ClosedKeyPath" << "ReadKeyPath" << "WriteKeyPath"
- << "OpenIpcPath" << "ClosedIpcPath" << "OpenWinClass" << "OpenClsid" << "ClosedClsid" << "ClosedRT";
+ QStringList Keys = QStringList()
+ << "NormalFilePath" << "OpenFilePath" << "OpenPipePath" << "ClosedFilePath" << "ReadFilePath" << "WriteFilePath"
+ << "NormalKeyPath" << "OpenKeyPath" << "OpenConfPath" << "ClosedKeyPath" << "ReadKeyPath" << "WriteKeyPath"
+ << "NormalIpcPath"<< "OpenIpcPath" << "ClosedIpcPath" << "OpenWinClass" << "OpenClsid" << "ClosedClsid" << "ClosedRT";
QMap> AccessMap;
for (int i = 0; i < ui.treeAccess->topLevelItemCount(); i++)
diff --git a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp
index 837860be..4bf5af46 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsAdvanced.cpp
@@ -15,9 +15,17 @@ void COptionsWindow::CreateAdvanced()
connect(ui.chkNestedJobs, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.chkUseSbieWndStation, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
+ connect(ui.chkAddToJob, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.chkProtectSCM, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
connect(ui.chkRestrictServices, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
- //connect(ui.chkProtectSystem, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
+ connect(ui.chkElevateRpcss, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
+ connect(ui.chkProtectSystem, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
+ connect(ui.chkDropPrivileges, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
+
+ connect(ui.chkOpenCOM, SIGNAL(clicked(bool)), this, SLOT(OnOpenCOM()));
+
+ connect(ui.chkNoSecurityIsolation, SIGNAL(clicked(bool)), this, SLOT(OnIsolationChanged()));
+ connect(ui.chkNoSecurityFiltering, SIGNAL(clicked(bool)), this, SLOT(OnIsolationChanged()));
connect(ui.chkOpenDevCMApi, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
//connect(ui.chkOpenLsaSSPI, SIGNAL(clicked(bool)), this, SLOT(OnAdvancedChanged()));
@@ -58,10 +66,15 @@ void COptionsWindow::LoadAdvanced()
ui.chkNestedJobs->setChecked(m_pBox->GetBool("AllowBoxedJobs", false));
ui.chkUseSbieWndStation->setChecked(m_pBox->GetBool("UseSbieWndStation", false));
+ ui.chkAddToJob->setChecked(!m_pBox->GetBool("NoAddProcessToJob", false));
ui.chkProtectSCM->setChecked(!m_pBox->GetBool("UnrestrictedSCM", false));
ui.chkRestrictServices->setChecked(!m_pBox->GetBool("RunServicesAsSystem", false));
- //ui.chkProtectSystem->setChecked(!m_pBox->GetBool("ExposeBoxedSystem", false));
+ ui.chkElevateRpcss->setChecked(m_pBox->GetBool("RunRpcssAsSystem", false));
+ ui.chkProtectSystem->setChecked(!m_pBox->GetBool("ExposeBoxedSystem", false));
+ ui.chkDropPrivileges->setChecked(m_pBox->GetBool("StripSystemPrivileges", true));
+ ui.chkNoSecurityIsolation->setChecked(m_pBox->GetBool("NoSecurityIsolation", false));
+ ui.chkNoSecurityFiltering->setChecked(m_pBox->GetBool("NoSecurityFiltering", false));
ui.chkOpenDevCMApi->setChecked(m_pBox->GetBool("OpenDevCMApi", false));
//ui.chkOpenLsaSSPI->setChecked(!m_pBox->GetBool("BlockPassword", true)); // OpenLsaSSPI
@@ -102,6 +115,11 @@ void COptionsWindow::LoadAdvanced()
ui.lstUsers->addItems(Users.mid(1));
ui.chkMonitorAdminOnly->setChecked(m_pBox->GetBool("MonitorAdminOnly", false));
+ UpdateBoxIsolation();
+
+ ui.chkOpenCredentials->setEnabled(!ui.chkOpenProtectedStorage->isChecked());
+ if (!ui.chkOpenCredentials->isEnabled()) ui.chkOpenCredentials->setChecked(true);
+
m_AdvancedChanged = false;
}
@@ -110,10 +128,16 @@ void COptionsWindow::SaveAdvanced()
WriteAdvancedCheck(ui.chkPreferExternalManifest, "PreferExternalManifest", "y", "");
WriteAdvancedCheck(ui.chkUseSbieWndStation, "UseSbieWndStation", "y", "");
+ WriteAdvancedCheck(ui.chkAddToJob, "NoAddProcessToJob", "", "y");
WriteAdvancedCheck(ui.chkProtectSCM, "UnrestrictedSCM", "", "y");
WriteAdvancedCheck(ui.chkNestedJobs, "AllowBoxedJobs", "y", "");
WriteAdvancedCheck(ui.chkRestrictServices, "RunServicesAsSystem", "", "y");
- //WriteAdvancedCheck(ui.chkProtectSystem, "ExposeBoxedSystem", "", "y");
+ WriteAdvancedCheck(ui.chkElevateRpcss, "RunRpcssAsSystem", "y", "");
+ WriteAdvancedCheck(ui.chkProtectSystem, "ExposeBoxedSystem", "", "y");
+ WriteAdvancedCheck(ui.chkDropPrivileges, "StripSystemPrivileges", "", "n");
+
+ WriteAdvancedCheck(ui.chkNoSecurityIsolation, "NoSecurityIsolation", "y", "");
+ WriteAdvancedCheck(ui.chkNoSecurityFiltering, "NoSecurityFiltering", "y", "");
WriteAdvancedCheck(ui.chkOpenDevCMApi, "OpenDevCMApi", "y", "");
//WriteAdvancedCheck(ui.chkOpenLsaSSPI, "BlockPassword", "n", ""); // OpenLsaSSPI
@@ -158,21 +182,68 @@ void COptionsWindow::SaveAdvanced()
m_AdvancedChanged = false;
}
-void COptionsWindow::OnAdvancedChanged()
+void COptionsWindow::OnIsolationChanged()
{
- ui.chkOpenCredentials->setEnabled(!ui.chkOpenProtectedStorage->isChecked());
- if (!ui.chkOpenCredentials->isEnabled()) ui.chkOpenCredentials->setChecked(true);
+ if (ui.chkPrivacy->isChecked() || ui.chkUseSpecificity->isChecked())
+ theGUI->CheckCertificate();
+
+ UpdateBoxIsolation();
m_AdvancedChanged = true;
+ OnOptChanged();
+}
+
+void COptionsWindow::UpdateBoxIsolation()
+{
+ ui.chkNoSecurityFiltering->setEnabled(ui.chkNoSecurityIsolation->isChecked());
+
+ ui.chkAddToJob->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
+
+ ui.chkOpenDevCMApi->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
+ ui.chkOpenSamEndpoint->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
+ ui.chkOpenLsaEndpoint->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
+
+
+ ui.chkRawDiskRead->setEnabled(!ui.chkNoSecurityIsolation->isChecked()); // without isolation only user mode
+ ui.chkRawDiskNotify->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
+
+ ui.chkDropRights->setEnabled(!ui.chkNoSecurityIsolation->isChecked() && !theAPI->IsRunningAsAdmin());
+
+ ui.chkBlockNetShare->setEnabled(!ui.chkNoSecurityFiltering->isChecked());
+
+ ui.chkBlockSpooler->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
+ ui.chkOpenSpooler->setEnabled(!ui.chkBlockSpooler->isChecked() && !ui.chkNoSecurityIsolation->isChecked());
+ ui.chkPrintToFile->setEnabled(!ui.chkBlockSpooler->isChecked() && !ui.chkNoSecurityFiltering->isChecked());
+
+ ui.chkCloseClipBoard->setEnabled(!ui.chkNoSecurityIsolation->isChecked());
+}
+
+void COptionsWindow::OnAdvancedChanged()
+{
+ m_AdvancedChanged = true;
+ OnOptChanged();
+}
+
+void COptionsWindow::OnOpenCOM()
+{
+ if (ui.chkOpenCOM->isChecked()) {
+ SetAccessEntry(eIPC, "", eOpen, "\\RPC Control\\epmapper");
+ SetAccessEntry(eIPC, "", eOpen, "*\\BaseNamedObjects*\\__ComCatalogCache__");
+ }
+ else {
+ DelAccessEntry(eIPC, "", eOpen, "\\RPC Control\\epmapper");
+ DelAccessEntry(eIPC, "", eOpen, "*\\BaseNamedObjects*\\__ComCatalogCache__");
+ }
}
void COptionsWindow::OnNoWindowRename()
{
if (ui.chkNoWindowRename->isChecked())
- SetAccessEntry(eWnd, "", eDirect, "#");
+ SetAccessEntry(eWnd, "", eOpen, "#");
else
- DelAccessEntry(eWnd, "", eDirect, "#");
+ DelAccessEntry(eWnd, "", eOpen, "#");
m_AdvancedChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnAddAutoExec()
@@ -184,6 +255,7 @@ void COptionsWindow::OnAddAutoExec()
ui.lstAutoExec->addItem(Process);
m_AdvancedChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelAutoExec()
@@ -192,6 +264,7 @@ void COptionsWindow::OnDelAutoExec()
delete pItem;
m_AdvancedChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnAddProcess()
@@ -203,6 +276,7 @@ void COptionsWindow::OnAddProcess()
ui.lstProcesses->addItem(Process);
m_AdvancedChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelProcess()
@@ -211,6 +285,7 @@ void COptionsWindow::OnDelProcess()
delete pItem;
m_AdvancedChanged = true;
+ OnOptChanged();
}
#include
@@ -281,6 +356,7 @@ void COptionsWindow::OnAddUser()
ui.lstUsers->addItems(Users);
m_AdvancedChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelUser()
@@ -326,6 +402,7 @@ void COptionsWindow::OnDebugChanged()
{
QCheckBox* pCheck = qobject_cast(sender());
m_DebugOptions[pCheck].Changed = true;
+ OnOptChanged();
}
void COptionsWindow::LoadDebug()
diff --git a/SandboxiePlus/SandMan/Windows/OptionsForce.cpp b/SandboxiePlus/SandMan/Windows/OptionsForce.cpp
index a6da670c..cbfc2bfd 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsForce.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsForce.cpp
@@ -91,6 +91,7 @@ void COptionsWindow::OnForceProg()
return;
AddForcedEntry(Value, 1);
m_ForcedChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnForceDir()
@@ -100,10 +101,12 @@ void COptionsWindow::OnForceDir()
return;
AddForcedEntry(Value, 2);
m_ForcedChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelForce()
{
DeleteAccessEntry(ui.treeForced->currentItem());
m_ForcedChanged = true;
+ OnOptChanged();
}
diff --git a/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp b/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp
index 5ab451f7..394b4b15 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp
@@ -18,6 +18,40 @@ void COptionsWindow::CreateGeneral()
ui.cmbBoxBorder->addItem(tr("Show only when title is in focus"), "ttl");
ui.cmbBoxBorder->addItem(tr("Always show"), "on");
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eHardenedPlus), tr("Hardened Sandbox with Data Protection"), (int)CSandBoxPlus::eHardenedPlus);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eHardened), tr("Security Hardened Sandbox"), (int)CSandBoxPlus::eHardened);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eDefaultPlus), tr("Sandbox with Data Protection"), (int)CSandBoxPlus::eDefaultPlus);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eDefault), tr("Standard Isolation Sandbox (Default)"), (int)CSandBoxPlus::eDefault);
+ //ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eInsecure), tr("UNSECURE Configuration (please change)"), (int)CSandBoxPlus::eInsecure);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eAppBoxPlus), tr("Application Compartment with Data Protection"), (int)CSandBoxPlus::eAppBoxPlus);
+ ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eAppBox), tr("Application Compartment (NO Isolation)"), (int)CSandBoxPlus::eAppBox);
+
+ ui.lblSupportCert->setVisible(false);
+ if (g_Certificate.isEmpty())
+ {
+ ui.lblSupportCert->setVisible(true);
+ connect(ui.lblSupportCert, SIGNAL(linkActivated(const QString&)), theGUI, SLOT(OpenUrl(const QString&)));
+
+ for (int i = 0; i < ui.cmbBoxType->count(); i++)
+ {
+ int BoxType = ui.cmbBoxType->itemData(i, Qt::UserRole).toInt();
+ bool disabled = BoxType != CSandBoxPlus::eDefault && BoxType != CSandBoxPlus::eHardened;
+
+ QStandardItemModel* model = qobject_cast(ui.cmbBoxType->model());
+ QStandardItem* item = model->item(i);
+ item->setFlags(disabled ? item->flags() & ~Qt::ItemIsEnabled : item->flags() | Qt::ItemIsEnabled);
+ }
+ }
+
+
+ m_HoldBoxType = false;
+
+ connect(ui.cmbBoxType, SIGNAL(currentIndexChanged(int)), this, SLOT(OnBoxTypChanged()));
+ connect(ui.chkDropRights, SIGNAL(clicked(bool)), this, SLOT(UpdateBoxType()));
+ connect(ui.chkPrivacy, SIGNAL(clicked(bool)), this, SLOT(UpdateBoxType()));
+ connect(ui.chkNoSecurityIsolation, SIGNAL(clicked(bool)), this, SLOT(UpdateBoxType()));
+ connect(ui.chkNoSecurityFiltering, SIGNAL(clicked(bool)), this, SLOT(UpdateBoxType()));
+
connect(ui.cmbBoxIndicator, SIGNAL(currentIndexChanged(int)), this, SLOT(OnGeneralChanged()));
connect(ui.cmbBoxBorder, SIGNAL(currentIndexChanged(int)), this, SLOT(OnGeneralChanged()));
connect(ui.btnBorderColor, SIGNAL(clicked(bool)), this, SLOT(OnPickColor()));
@@ -63,7 +97,6 @@ void COptionsWindow::CreateGeneral()
pAutoBtnMenu->addAction(tr("Browse for Program"), this, SLOT(OnAddAutoExe()));
ui.btnAddAutoExe->setPopupMode(QToolButton::MenuButtonPopup);
ui.btnAddAutoExe->setMenu(pAutoBtnMenu);
- connect(ui.btnAddAutoExe, SIGNAL(clicked(bool)), this, SLOT(OnAddAutoExe()));
connect(ui.btnAddAutoSvc, SIGNAL(clicked(bool)), this, SLOT(OnDelAutoSvc()));
connect(ui.btnDelAuto, SIGNAL(clicked(bool)), this, SLOT(OnDelAuto()));
}
@@ -91,19 +124,16 @@ void COptionsWindow::LoadGeneral()
ui.chkBlockSpooler->setChecked(m_pBox->GetBool("ClosePrintSpooler", false));
ui.chkOpenSpooler->setChecked(m_pBox->GetBool("OpenPrintSpooler", false));
- ui.chkOpenSpooler->setEnabled(!ui.chkBlockSpooler->isChecked());
ui.chkPrintToFile->setChecked(m_pBox->GetBool("AllowSpoolerPrintToFile", false));
- ui.chkPrintToFile->setEnabled(!ui.chkBlockSpooler->isChecked());
ui.chkOpenProtectedStorage->setChecked(m_pBox->GetBool("OpenProtectedStorage", false));
- ui.chkOpenCredentials->setEnabled(!ui.chkOpenProtectedStorage->isChecked());
ui.chkOpenCredentials->setChecked(!ui.chkOpenCredentials->isEnabled() || m_pBox->GetBool("OpenCredentials", false));
ui.chkCloseClipBoard->setChecked(!m_pBox->GetBool("OpenClipboard", true));
//ui.chkOpenSmartCard->setChecked(m_pBox->GetBool("OpenSmartCard", true));
//ui.chkOpenBluetooth->setChecked(m_pBox->GetBool("OpenBluetooth", false));
ui.treeAutoStart->clear();
- foreach(const QString & Value, m_pBox->GetTextList("StartProgram", m_Template))
+ foreach(const QString & Value, m_pBox->GetTextList("StartCommand", m_Template))
AddAutoRunItem(Value, 0);
foreach(const QString & Value, m_pBox->GetTextList("StartService", m_Template))
AddAutoRunItem(Value, 1);
@@ -173,7 +203,7 @@ void COptionsWindow::SaveGeneral()
else
StartProgram.append(pItem->text(1));
}
- WriteTextList("StartProgram", StartProgram);
+ WriteTextList("StartCommand", StartProgram);
WriteTextList("StartService", StartService);
QStringList RunCommands;
@@ -199,8 +229,6 @@ void COptionsWindow::SaveGeneral()
void COptionsWindow::OnGeneralChanged()
{
- m_GeneralChanged = true;
-
ui.lblCopyLimit->setEnabled(ui.chkCopyLimit->isChecked());
ui.txtCopyLimit->setEnabled(ui.chkCopyLimit->isChecked());
ui.lblCopyLimit->setText(tr("kilobytes (%1)").arg(FormatSize(ui.txtCopyLimit->text().toULongLong() * 1024)));
@@ -209,16 +237,23 @@ void COptionsWindow::OnGeneralChanged()
ui.chkAutoEmpty->setEnabled(!ui.chkProtectBox->isChecked());
- ui.chkOpenSpooler->setEnabled(!ui.chkBlockSpooler->isChecked());
- ui.chkPrintToFile->setEnabled(!ui.chkBlockSpooler->isChecked());
+ ui.chkOpenSpooler->setEnabled(!ui.chkBlockSpooler->isChecked() && !ui.chkNoSecurityIsolation->isChecked());
+ ui.chkPrintToFile->setEnabled(!ui.chkBlockSpooler->isChecked() && !ui.chkNoSecurityFiltering->isChecked());
+
+ ui.chkOpenCredentials->setEnabled(!ui.chkOpenProtectedStorage->isChecked());
+ if (!ui.chkOpenCredentials->isEnabled()) ui.chkOpenCredentials->setChecked(true);
+
+ m_GeneralChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnPickColor()
{
- QColor color = QColorDialog::getColor(m_BorderColor, this, tr("Select color"));
+ QColor color = QColorDialog::getColor(m_BorderColor, this, "Select color");
if (!color.isValid())
return;
m_GeneralChanged = true;
+ OnOptChanged();
m_BorderColor = color;
ui.btnBorderColor->setStyleSheet("background-color: " + m_BorderColor.name());
}
@@ -231,6 +266,7 @@ void COptionsWindow::OnAddAutoCmd()
AddAutoRunItem(Value, 0);
m_GeneralChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnAddAutoExe()
@@ -241,6 +277,7 @@ void COptionsWindow::OnAddAutoExe()
AddAutoRunItem(Value, 0);
m_GeneralChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelAutoSvc()
@@ -251,6 +288,7 @@ void COptionsWindow::OnDelAutoSvc()
AddAutoRunItem(Value, 1);
m_GeneralChanged = true;
+ OnOptChanged();
}
void COptionsWindow::AddAutoRunItem(const QString& Value, int Type)
@@ -271,6 +309,7 @@ void COptionsWindow::OnDelAuto()
delete pItem;
m_GeneralChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnBrowsePath()
@@ -285,6 +324,7 @@ void COptionsWindow::OnBrowsePath()
AddRunItem(Name, Value);
m_GeneralChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnAddCommand()
@@ -299,6 +339,7 @@ void COptionsWindow::OnAddCommand()
AddRunItem(Name, Value);
m_GeneralChanged = true;
+ OnOptChanged();
}
void COptionsWindow::AddRunItem(const QString& Name, const QString& Command)
@@ -318,4 +359,73 @@ void COptionsWindow::OnDelCommand()
delete pItem;
m_GeneralChanged = true;
+ OnOptChanged();
+}
+
+void COptionsWindow::UpdateBoxType()
+{
+ bool bPrivacyMode = ui.chkPrivacy->isChecked();
+ bool bNoAdmin = ui.chkDropRights->isChecked();
+ bool bAppBox = ui.chkNoSecurityIsolation->isChecked();
+
+ int BoxType;
+ if (bAppBox)
+ BoxType = bPrivacyMode ? (int)CSandBoxPlus::eAppBoxPlus : (int)CSandBoxPlus::eAppBox;
+ else if (bNoAdmin)
+ BoxType = bPrivacyMode ? (int)CSandBoxPlus::eHardenedPlus : (int)CSandBoxPlus::eHardened;
+ else
+ BoxType = bPrivacyMode ? (int)CSandBoxPlus::eDefaultPlus : (int)CSandBoxPlus::eDefault;
+
+ ui.lblBoxInfo->setText(theGUI->GetBoxDescription(BoxType));
+
+ if (m_HoldBoxType)
+ return;
+
+ m_HoldBoxType = true;
+ ui.cmbBoxType->setCurrentIndex(ui.cmbBoxType->findData(BoxType));
+ m_HoldBoxType = false;
+}
+
+void COptionsWindow::OnBoxTypChanged()
+{
+ if (m_HoldBoxType)
+ return;
+
+ int BoxType = ui.cmbBoxType->currentData().toInt();
+
+ switch (BoxType) {
+ case CSandBoxPlus::eHardenedPlus:
+ case CSandBoxPlus::eHardened:
+ ui.chkNoSecurityIsolation->setChecked(false);
+ ui.chkNoSecurityFiltering->setChecked(false);
+ ui.chkDropRights->setChecked(true);
+ ui.chkMsiExemptions->setChecked(false);
+ //ui.chkRestrictServices->setChecked(true);
+ ui.chkPrivacy->setChecked(BoxType == CSandBoxPlus::eHardenedPlus);
+ break;
+ case CSandBoxPlus::eDefaultPlus:
+ case CSandBoxPlus::eDefault:
+ ui.chkNoSecurityIsolation->setChecked(false);
+ ui.chkNoSecurityFiltering->setChecked(false);
+ ui.chkDropRights->setChecked(false);
+ ui.chkMsiExemptions->setChecked(false);
+ //ui.chkRestrictServices->setChecked(true);
+ ui.chkPrivacy->setChecked(BoxType == CSandBoxPlus::eDefaultPlus);
+ break;
+ case CSandBoxPlus::eAppBoxPlus:
+ case CSandBoxPlus::eAppBox:
+ ui.chkNoSecurityIsolation->setChecked(true);
+ //ui.chkRestrictServices->setChecked(false);
+ ui.chkPrivacy->setChecked(BoxType == CSandBoxPlus::eAppBoxPlus);
+ break;
+ }
+
+ m_GeneralChanged = true;
+ m_AccessChanged = true;
+ m_AdvancedChanged = true;
+
+ m_HoldBoxType = true;
+ UpdateBoxType();
+ m_HoldBoxType = false;
+ OnOptChanged();
}
diff --git a/SandboxiePlus/SandMan/Windows/OptionsGrouping.cpp b/SandboxiePlus/SandMan/Windows/OptionsGrouping.cpp
index 5d815104..c6abb63c 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsGrouping.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsGrouping.cpp
@@ -11,7 +11,6 @@
void COptionsWindow::LoadGroups()
{
- m_TemplateGroups.clear();
ui.treeGroups->clear();
QStringList ProcessGroups = m_pBox->GetTextList("ProcessGroup", m_Template);
@@ -51,7 +50,6 @@ void COptionsWindow::LoadGroupsTmpl(bool bUpdate)
{
foreach(const QString& Group, m_pBox->GetTextListTmpl("ProcessGroup", Template))
{
- m_TemplateGroups.insert(Group);
QStringList Entries = Group.split(",");
QString GroupName = Entries.takeFirst();
@@ -90,6 +88,31 @@ void COptionsWindow::LoadGroupsTmpl(bool bUpdate)
}
}
+QStringList COptionsWindow::GetCurrentGroups()
+{
+ QStringList Groups;
+
+ for (int i = 0; i < ui.treeGroups->topLevelItemCount(); i++)
+ {
+ QTreeWidgetItem* pItem = ui.treeGroups->topLevelItem(i);
+ QString GroupName = pItem->data(0, Qt::UserRole).toString();
+ Groups.append(GroupName);
+ }
+
+ foreach(const QString& Template, m_pBox->GetTemplates())
+ {
+ foreach(const QString& Group, m_pBox->GetTextListTmpl("ProcessGroup", Template))
+ {
+ QStringList Entries = Group.split(",");
+ QString GroupName = Entries.takeFirst();
+ if (!Groups.contains(GroupName))
+ Groups.append(GroupName);
+ }
+ }
+
+ return Groups;
+}
+
void COptionsWindow::SaveGroups()
{
QStringList ProcessGroups;
@@ -103,8 +126,6 @@ void COptionsWindow::SaveGroups()
for (int j = 0; j < pItem->childCount(); j++)
Programs.append(pItem->child(j)->data(0, Qt::UserRole).toString());
QString Group = GroupName + "," + Programs.join(",");
- if (m_TemplateGroups.contains(Group))
- continue; // don't save unchanged groups to local config
ProcessGroups.append(Group);
}
@@ -131,6 +152,7 @@ void COptionsWindow::OnAddGroup()
ui.treeGroups->addTopLevelItem(pItem);
m_GroupsChanged = true;
+ OnOptChanged();
}
void COptionsWindow::AddProgToGroup(QTreeWidget* pTree, const QString& Groupe)
@@ -172,6 +194,7 @@ void COptionsWindow::AddProgToGroup(const QString& Value, const QString& Groupe)
pGroupItem->addChild(pProgItem);
m_GroupsChanged = true;
+ OnOptChanged();
}
void COptionsWindow::DelProgFromGroup(QTreeWidget* pTree, const QString& Groupe)
@@ -196,6 +219,7 @@ void COptionsWindow::DelProgFromGroup(QTreeWidget* pTree, const QString& Groupe)
{
delete pProgItem;
m_GroupsChanged = true;
+ OnOptChanged();
break;
}
}
@@ -214,6 +238,7 @@ void COptionsWindow::AddProgramToGroup(const QString& Program, const QString& Gr
pItem->addChild(pSubItem);
m_GroupsChanged = true;
+ OnOptChanged();
}
void COptionsWindow::DelProgramFromGroup(const QString& Program, const QString& Group)
@@ -229,6 +254,7 @@ void COptionsWindow::DelProgramFromGroup(const QString& Program, const QString&
}
m_GroupsChanged = true;
+ OnOptChanged();
}
QTreeWidgetItem* COptionsWindow::FindGroupByName(const QString& Group, bool bAdd)
@@ -280,6 +306,7 @@ void COptionsWindow::OnAddProg()
pItem->addChild(pSubItem);
m_GroupsChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelProg()
@@ -296,6 +323,7 @@ void COptionsWindow::OnDelProg()
delete pItem;
m_GroupsChanged = true;
+ OnOptChanged();
}
void COptionsWindow::CopyGroupToList(const QString& Groupe, QTreeWidget* pTree)
diff --git a/SandboxiePlus/SandMan/Windows/OptionsNetwork.cpp b/SandboxiePlus/SandMan/Windows/OptionsNetwork.cpp
index da75c7a2..9861c39a 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsNetwork.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsNetwork.cpp
@@ -240,6 +240,7 @@ void COptionsWindow::OnBlockINet()
DelAccessEntry(eFile, "!", eClosed, "InternetAccessDevices");
m_INetBlockChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnAddINetProg()
@@ -262,6 +263,7 @@ void COptionsWindow::OnAddINetProg()
AddProgramToGroup(Value, INetModeToGroup(Mode));
//m_INetBlockChanged = true;
+ //OnOptChanged();
}
void COptionsWindow::OnDelINetProg()
@@ -277,6 +279,7 @@ void COptionsWindow::OnDelINetProg()
delete pItem;
//m_INetBlockChanged = true;
+ //OnOptChanged();
}
bool COptionsWindow::FindEntryInSettingList(const QString& Name, const QString& Value)
@@ -560,6 +563,7 @@ void COptionsWindow::CloseNetFwEdit(QTreeWidgetItem* pItem, bool bSave)
pItem->setData(4, Qt::UserRole, pProt->currentData());
m_NetFwRulesChanged = true;
+ OnOptChanged();
}
for (int i = 0; i < 5; i++)
@@ -579,6 +583,7 @@ void COptionsWindow::OnAddNetFwRule()
ui.treeNetFw->addTopLevelItem(pItem);
m_NetFwRulesChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelNetFwRule()
@@ -589,8 +594,8 @@ void COptionsWindow::OnDelNetFwRule()
delete pItem;
-
m_NetFwRulesChanged = true;
+ OnOptChanged();
}
void COptionsWindow__SetRowColor(QTreeWidgetItem* pItem, bool bMatch, bool bConflict = false, bool bBlock = false, bool bActive = false)
diff --git a/SandboxiePlus/SandMan/Windows/OptionsRecovery.cpp b/SandboxiePlus/SandMan/Windows/OptionsRecovery.cpp
index 05c58be6..988d43b7 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsRecovery.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsRecovery.cpp
@@ -97,6 +97,7 @@ void COptionsWindow::OnAddRecFolder()
AddRecoveryEntry(Value, 1);
m_RecoveryChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnAddRecIgnore()
@@ -107,6 +108,7 @@ void COptionsWindow::OnAddRecIgnore()
AddRecoveryEntry(Value, 2);
m_RecoveryChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnAddRecIgnoreExt()
@@ -117,6 +119,7 @@ void COptionsWindow::OnAddRecIgnoreExt()
AddRecoveryEntry(Value, 2);
m_RecoveryChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelRecEntry()
@@ -132,4 +135,5 @@ void COptionsWindow::OnDelRecEntry()
delete pItem;
m_RecoveryChanged = true;
+ OnOptChanged();
}
diff --git a/SandboxiePlus/SandMan/Windows/OptionsStart.cpp b/SandboxiePlus/SandMan/Windows/OptionsStart.cpp
index 7aef0ce4..0c9fb785 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsStart.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsStart.cpp
@@ -41,16 +41,19 @@ void COptionsWindow::OnRestrictStart()
ui.chkStartBlockMsg->setEnabled(!ui.radStartAll->isChecked());
//m_StartChanged = true;
+ //OnOptChanged();
}
void COptionsWindow::OnAddStartProg()
{
AddProgToGroup(ui.treeStart, "");
//m_StartChanged = true;
+ //OnOptChanged();
}
void COptionsWindow::OnDelStartProg()
{
DelProgFromGroup(ui.treeStart, "");
//m_StartChanged = true;
+ //OnOptChanged();
}
diff --git a/SandboxiePlus/SandMan/Windows/OptionsStop.cpp b/SandboxiePlus/SandMan/Windows/OptionsStop.cpp
index bc15e7de..123f9770 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsStop.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsStop.cpp
@@ -91,6 +91,7 @@ void COptionsWindow::OnAddLingering()
return;
AddStopEntry(Value, 1);
m_StopChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnAddLeader()
@@ -100,10 +101,12 @@ void COptionsWindow::OnAddLeader()
return;
AddStopEntry(Value, 2);
m_StopChanged = true;
+ OnOptChanged();
}
void COptionsWindow::OnDelStopProg()
{
DeleteAccessEntry(ui.treeStop->currentItem());
m_StopChanged = true;
+ OnOptChanged();
}
diff --git a/SandboxiePlus/SandMan/Windows/OptionsTemplates.cpp b/SandboxiePlus/SandMan/Windows/OptionsTemplates.cpp
index 75561d83..be598a26 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsTemplates.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsTemplates.cpp
@@ -85,6 +85,7 @@ void COptionsWindow::OnScreenReaders()
else
m_BoxTemplates.removeAll("ScreenReader");
m_TemplatesChanged = true;
+ OnOptChanged();
}
QString COptionsWindow::GetCategoryName(const QString& Category)
@@ -154,12 +155,14 @@ void COptionsWindow::OnTemplateClicked(QTreeWidgetItem* pItem, int Column)
if (!m_BoxTemplates.contains(Name)) {
m_BoxTemplates.append(Name);
m_TemplatesChanged = true;
+ OnOptChanged();
}
}
else if (pItem->checkState(1) == Qt::Unchecked) {
if (m_BoxTemplates.contains(Name)) {
m_BoxTemplates.removeAll(Name);
m_TemplatesChanged = true;
+ OnOptChanged();
}
}
}
@@ -254,6 +257,7 @@ void COptionsWindow::OnFolderChanged()
{
//CPathEdit* pEdit = (CPathEdit*)sender();
m_FoldersChanged = true;
+ OnOptChanged();
}
void COptionsWindow::ShowFolders()
diff --git a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp
index 398a298a..2e5f43d0 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp
+++ b/SandboxiePlus/SandMan/Windows/OptionsWindow.cpp
@@ -17,6 +17,8 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri
m_Template = pBox->GetName().left(9).compare("Template_", Qt::CaseInsensitive) == 0;
bool ReadOnly = /*pBox->GetAPI()->IsConfigLocked() ||*/ (m_Template && pBox->GetName().mid(9, 6).compare("Local_", Qt::CaseInsensitive) != 0);
+ m_HoldChange = false;
+
QSharedPointer pBoxPlus = m_pBox.objectCast();
if (!pBoxPlus.isNull())
m_Programs = pBoxPlus->GetRecentPrograms();
@@ -120,10 +122,6 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri
CreateAccess();
- // Resource Access
- connect(ui.chkCloseForBox, SIGNAL(clicked(bool)), this, SLOT(OnAccessChanged()));
- //
-
// Recovery
connect(ui.chkAutoRecovery, SIGNAL(clicked(bool)), this, SLOT(OnRecoveryChanged()));
connect(ui.btnAddRecovery, SIGNAL(clicked(bool)), this, SLOT(OnAddRecFolder()));
@@ -152,6 +150,8 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri
connect(ui.btnEditIni, SIGNAL(clicked(bool)), this, SLOT(OnEditIni()));
connect(ui.btnSaveIni, SIGNAL(clicked(bool)), this, SLOT(OnSaveIni()));
connect(ui.btnCancelEdit, SIGNAL(clicked(bool)), this, SLOT(OnCancelEdit()));
+ connect(ui.txtIniSection, SIGNAL(textChanged()), this, SLOT(OnOptChanged()));
+
//
connect(ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked(bool)), this, SLOT(ok()));
@@ -162,7 +162,6 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri
{
ui.btnEditIni->setEnabled(false);
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
- ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
}
if (theAPI->IsRunningAsAdmin())
@@ -175,6 +174,8 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri
LoadConfig();
+ ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
+
ui.treeAccess->viewport()->installEventFilter(this);
ui.treeINet->viewport()->installEventFilter(this);
ui.treeNetFw->viewport()->installEventFilter(this);
@@ -206,6 +207,12 @@ COptionsWindow::COptionsWindow(const QSharedPointer& pBox, const QStri
if (!Columns.isEmpty()) ui.treeTemplates->header()->restoreState(Columns);
}
+void COptionsWindow::OnOptChanged() {
+ if (m_HoldChange)
+ return;
+ ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
+}
+
COptionsWindow::~COptionsWindow()
{
theConf->SetBlob("OptionsWindow/Window_Geometry",saveGeometry());
@@ -309,6 +316,7 @@ void COptionsWindow::LoadConfig()
LoadTemplates();
+ UpdateBoxType();
}
void COptionsWindow::WriteAdvancedCheck(QCheckBox* pCheck, const QString& Name, const QString& Value)
@@ -328,6 +336,9 @@ void COptionsWindow::WriteAdvancedCheck(QCheckBox* pCheck, const QString& Name,
//if (pCheck->checkState() == Qt::PartiallyChecked)
// return;
+ if (!pCheck->isEnabled())
+ return;
+
SB_STATUS Status;
if (pCheck->checkState() == Qt::Checked)
{
@@ -435,6 +446,8 @@ void COptionsWindow::apply()
UpdateCurrentTab();
emit OptionsChanged();
+
+ ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
}
void COptionsWindow::ok()
@@ -485,9 +498,9 @@ QString COptionsWindow::SelectProgram(bool bOrGroup)
if (bOrGroup)
{
- for (int i = 0; i < ui.treeGroups->topLevelItemCount(); i++) {
- QTreeWidgetItem* pItem = ui.treeGroups->topLevelItem(i);
- progDialog.addItem(tr("Group: %1").arg(pItem->text(0)), pItem->data(0, Qt::UserRole).toString());
+ foreach(const QString Group, GetCurrentGroups()){
+ QString GroupName = Group.mid(1, Group.length() - 2);
+ progDialog.addItem(tr("Group: %1").arg(Group), GroupName);
}
}
@@ -548,7 +561,9 @@ void COptionsWindow::UpdateCurrentTab()
}
else if (ui.tabs->currentWidget() == ui.tabAdvanced)
{
- if (GetAccessEntry(eWnd, "", eDirect, "*") != NULL)
+ ui.chkOpenCOM->setChecked(GetAccessEntry(eIPC, "", eOpen, "\\RPC Control\\epmapper") != NULL);
+
+ if (GetAccessEntry(eWnd, "", eOpen, "*") != NULL)
{
ui.chkNoWindowRename->setEnabled(false);
ui.chkNoWindowRename->setChecked(true);
@@ -556,7 +571,7 @@ void COptionsWindow::UpdateCurrentTab()
else
{
ui.chkNoWindowRename->setEnabled(true);
- ui.chkNoWindowRename->setChecked(GetAccessEntry(eWnd, "", eDirect, "#") != NULL);
+ ui.chkNoWindowRename->setChecked(GetAccessEntry(eWnd, "", eOpen, "#") != NULL);
}
}
}
@@ -609,7 +624,9 @@ void COptionsWindow::LoadIniSection()
else
Section = m_pBox->GetAPI()->SbieIniGetEx(m_pBox->GetName(), "");
+ m_HoldChange = true;
ui.txtIniSection->setPlainText(Section);
+ m_HoldChange = false;
}
void COptionsWindow::SaveIniSection()
diff --git a/SandboxiePlus/SandMan/Windows/OptionsWindow.h b/SandboxiePlus/SandMan/Windows/OptionsWindow.h
index bd43c6d1..54237ab0 100644
--- a/SandboxiePlus/SandMan/Windows/OptionsWindow.h
+++ b/SandboxiePlus/SandMan/Windows/OptionsWindow.h
@@ -27,8 +27,13 @@ private slots:
//void OnWithTemplates();
+ void OnOptChanged();
+
void OnPickColor();
+ void OnBoxTypChanged();
+ void UpdateBoxType();
+
void OnBrowsePath();
void OnAddCommand();
void OnDelCommand();
@@ -59,13 +64,13 @@ private slots:
// net
void OnINetItemDoubleClicked(QTreeWidgetItem* pItem, int Column);
- void OnINetSelectionChanged() { CloseINetEdit(); }
+ void OnINetSelectionChanged() { CloseINetEdit(); OnOptChanged();}
void OnBlockINet();
void OnAddINetProg();
void OnDelINetProg();
void OnNetFwItemDoubleClicked(QTreeWidgetItem* pItem, int Column);
- void OnNetFwSelectionChanged() { CloseNetFwEdit(); }
+ void OnNetFwSelectionChanged() { CloseNetFwEdit(); OnOptChanged();}
void OnAddNetFwRule();
void OnDelNetFwRule();
@@ -78,15 +83,15 @@ private slots:
// access
//void OnAccessItemClicked(QTreeWidgetItem* pItem, int Column);
void OnAccessItemDoubleClicked(QTreeWidgetItem* pItem, int Column);
- void OnAccessSelectionChanged() { CloseAccessEdit(); }
+ void OnAccessSelectionChanged() { CloseAccessEdit(); OnOptChanged();}
- void OnAddFile() { AddAccessEntry(eFile, eDirect, "", ""); m_AccessChanged = true; }
+ void OnAddFile() { AddAccessEntry(eFile, eOpen, "", ""); m_AccessChanged = true; OnOptChanged(); }
void OnBrowseFile();
void OnBrowseFolder();
- void OnAddKey() { AddAccessEntry(eKey, eDirect, "", ""); m_AccessChanged = true; }
- void OnAddIPC() { AddAccessEntry(eIPC, eDirect, "", ""); m_AccessChanged = true; }
- void OnAddWnd() { AddAccessEntry(eWnd, eDirect, "", ""); m_AccessChanged = true; }
- void OnAddCOM() { AddAccessEntry(eCOM, eDirect, "", ""); m_AccessChanged = true; }
+ void OnAddKey() { AddAccessEntry(eKey, eOpen, "", ""); m_AccessChanged = true; OnOptChanged(); }
+ void OnAddIPC() { AddAccessEntry(eIPC, eOpen, "", ""); m_AccessChanged = true; OnOptChanged(); }
+ void OnAddWnd() { AddAccessEntry(eWnd, eOpen, "", ""); m_AccessChanged = true; OnOptChanged(); }
+ void OnAddCOM() { AddAccessEntry(eCOM, eOpen, "", ""); m_AccessChanged = true; OnOptChanged(); }
void OnDelAccess();
void OnShowAccessTmpl() { LoadAccessListTmpl(true); }
//
@@ -119,12 +124,14 @@ private slots:
void OnTab();
void OnGeneralChanged();
- void OnStartChanged() { m_StartChanged = true; }
- //void OnRestrictionChanged() { m_RestrictionChanged = true; }
- void OnINetBlockChanged() { m_INetBlockChanged = true; }
- void OnRecoveryChanged() { m_RecoveryChanged = true; }
- void OnAccessChanged() { m_AccessChanged = true; }
+ void OnStartChanged() { m_StartChanged = true; OnOptChanged(); }
+ //void OnRestrictionChanged() { m_RestrictionChanged = true; OnOptChanged(); }
+ void OnINetBlockChanged() { m_INetBlockChanged = true; OnOptChanged(); }
+ void OnRecoveryChanged() { m_RecoveryChanged = true; OnOptChanged(); }
+ void OnAccessChanged();
void OnAdvancedChanged();
+ void OnOpenCOM();
+ void OnIsolationChanged();
void OnDebugChanged();
void SetIniEdit(bool bEnable);
@@ -155,17 +162,21 @@ protected:
enum EAccessEntry
{
+ eNormalFilePath,
eOpenFilePath,
eOpenPipePath,
eClosedFilePath,
eReadFilePath,
eWriteFilePath,
+ eNormalKeyPath,
eOpenKeyPath,
+ eOpenConfPath,
eClosedKeyPath,
eReadKeyPath,
eWriteKeyPath,
+ eNormalIpcPath,
eOpenIpcPath,
eClosedIpcPath,
@@ -189,8 +200,9 @@ protected:
enum EAccessMode
{
- eDirect,
- eDirectAll,
+ eNormal,
+ eOpen,
+ eOpen4All,
eClosed,
eClosedRT,
eReadOnly,
@@ -227,6 +239,7 @@ protected:
void LoadGroups();
void LoadGroupsTmpl(bool bUpdate = false);
void SaveGroups();
+ QStringList GetCurrentGroups();
void LoadForced();
void LoadForcedTmpl(bool bUpdate = false);
@@ -283,6 +296,8 @@ protected:
void CloseAccessEdit(bool bSave = true);
void CloseAccessEdit(QTreeWidgetItem* pItem, bool bSave = true);
+
+ void UpdateAccessPolicy();
//
void LoadRecoveryList();
@@ -293,6 +308,7 @@ protected:
void CreateAdvanced();
void LoadAdvanced();
void SaveAdvanced();
+ void UpdateBoxIsolation();
void CreateDebug();
void LoadDebug();
@@ -311,9 +327,13 @@ protected:
QString GetCategoryName(const QString& Category);
+ bool m_HoldChange;
+
bool m_ConfigDirty;
QColor m_BorderColor;
+ bool m_HoldBoxType;
+
bool m_GeneralChanged;
bool m_GroupsChanged;
bool m_ForcedChanged;
@@ -333,8 +353,6 @@ protected:
bool m_Template;
- QSet m_TemplateGroups;
-
QMultiMap> m_AllTemplates;
QStringList m_GlobalTemplates;
QStringList m_BoxTemplates;
diff --git a/SandboxiePlus/SandMan/Windows/SelectBoxWindow.cpp b/SandboxiePlus/SandMan/Windows/SelectBoxWindow.cpp
index 004de9cc..4eda963c 100644
--- a/SandboxiePlus/SandMan/Windows/SelectBoxWindow.cpp
+++ b/SandboxiePlus/SandMan/Windows/SelectBoxWindow.cpp
@@ -119,7 +119,7 @@ CSelectBoxWindow::CSelectBoxWindow(const QStringList& Commands, const QString& B
QTreeWidgetItem* pItem = new QTreeWidgetItem();
pItem->setText(0, pBox->GetName().replace("_", " "));
pItem->setData(0, Qt::UserRole, pBox->GetName());
- pItem->setData(0, Qt::DecorationRole, theGUI->GetBoxIcon(pBox->GetActiveProcessCount() > 0, pBoxEx->GetType()));
+ pItem->setData(0, Qt::DecorationRole, theGUI->GetBoxIcon(pBoxEx->GetType(), pBox->GetActiveProcessCount()));
if (pParent)
pParent->addChild(pItem);
else
diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp
index 264d6c05..5b686cc0 100644
--- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp
+++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp
@@ -121,6 +121,7 @@ CSettingsWindow::CSettingsWindow(QWidget *parent)
m_FeaturesChanged = false;
connect(ui.chkWFP, SIGNAL(stateChanged(int)), this, SLOT(OnFeaturesChanged()));
+ connect(ui.chkObjCb, SIGNAL(stateChanged(int)), this, SLOT(OnFeaturesChanged()));
m_WarnProgsChanged = false;
@@ -217,7 +218,7 @@ void CSettingsWindow::LoadSettings()
ui.chkNotifyRecovery->setChecked(!theConf->GetBool("Options/InstantRecovery", true));
ui.chkPanic->setChecked(theConf->GetBool("Options/EnablePanicKey", false));
- ui.keyPanic->setKeySequence(QKeySequence(theConf->GetString("Options/PanicKeySequence", "Shift+Pause")));
+ ui.keyPanic->setKeySequence(QKeySequence(theConf->GetString("Options/PanicKeySequence", "Ctrl+Alt+Cancel")));
ui.chkWatchConfig->setChecked(theConf->GetBool("Options/WatchIni", true));
@@ -238,6 +239,7 @@ void CSettingsWindow::LoadSettings()
ui.ipcRoot->setText(theAPI->GetGlobalSettings()->GetText("IpcRootPath", IpcRootPath_Default));
ui.chkWFP->setChecked(theAPI->GetGlobalSettings()->GetBool("NetworkEnableWFP", false));
+ ui.chkObjCb->setChecked(theAPI->GetGlobalSettings()->GetBool("EnableObjectFiltering", false));
ui.chkAdminOnly->setChecked(theAPI->GetGlobalSettings()->GetBool("EditAdminOnly", false));
ui.chkPassRequired->setChecked(!theAPI->GetGlobalSettings()->GetText("EditPassword", "").isEmpty());
@@ -260,6 +262,7 @@ void CSettingsWindow::LoadSettings()
ui.fileRoot->setEnabled(false);
ui.chkSeparateUserFolders->setEnabled(false);
ui.chkWFP->setEnabled(false);
+ ui.chkObjCb->setEnabled(false);
ui.regRoot->setEnabled(false);
ui.ipcRoot->setEnabled(false);
ui.chkAdminOnly->setEnabled(false);
@@ -291,7 +294,13 @@ void CSettingsWindow::LoadSettings()
QPalette palette = QApplication::palette();
if (theGUI->m_DarkTheme)
palette.setColor(QPalette::Text, Qt::black);
- palette.setColor(QPalette::Base, QColor(192, 255, 192));
+ if ((g_FeatureFlags & CSbieAPI::eSbieFeatureCert) == 0) {
+ palette.setColor(QPalette::Base, QColor(255, 255, 192));
+ ui.lblCertExp->setVisible(true);
+ }
+ else {
+ palette.setColor(QPalette::Base, QColor(192, 255, 192));
+ }
ui.txtCertificate->setPalette(palette);
}
@@ -361,6 +370,7 @@ void CSettingsWindow::SaveSettings()
theAPI->GetGlobalSettings()->SetBool("NetworkEnableWFP", ui.chkWFP->isChecked());
+ theAPI->GetGlobalSettings()->SetBool("EnableObjectFiltering", ui.chkObjCb->isChecked());
if (m_FeaturesChanged) {
m_FeaturesChanged = false;
@@ -464,6 +474,8 @@ void CSettingsWindow::SaveSettings()
if (theGUI->m_DarkTheme)
palette.setColor(QPalette::Text, Qt::black);
+ ui.lblCertExp->setVisible(false);
+
if (Certificate.isEmpty())
{
palette.setColor(QPalette::Base, Qt::white);
@@ -472,9 +484,17 @@ void CSettingsWindow::SaveSettings()
{
g_FeatureFlags = theAPI->GetFeatureFlags();
- QMessageBox::information(this, "Sandboxie-Plus", tr("Thank you for supporting the development of Sandboxie-Plus."));
+ if ((g_FeatureFlags & CSbieAPI::eSbieFeatureCert) == 0) {
+ QMessageBox::information(this, "Sandboxie-Plus", tr("This certificate is unfortunately expired."));
- palette.setColor(QPalette::Base, QColor(192, 255, 192));
+ palette.setColor(QPalette::Base, QColor(255, 255, 192));
+ ui.lblCertExp->setVisible(true);
+ }
+ else {
+ QMessageBox::information(this, "Sandboxie-Plus", tr("Thank you for supporting the development of Sandboxie-Plus."));
+
+ palette.setColor(QPalette::Base, QColor(192, 255, 192));
+ }
}
else
{
diff --git a/SandboxiePlus/version.h b/SandboxiePlus/version.h
index 5383f1e0..1eecbbe1 100644
--- a/SandboxiePlus/version.h
+++ b/SandboxiePlus/version.h
@@ -1,9 +1,9 @@
#pragma once
-#define VERSION_MJR 0
-#define VERSION_MIN 9
-#define VERSION_REV 8
-#define VERSION_UPD 4
+#define VERSION_MJR 1
+#define VERSION_MIN 0
+#define VERSION_REV 0
+#define VERSION_UPD 0
#ifndef STR
#define STR2(X) #X