Build 0.8.7

This commit is contained in:
DavidXanatos 2021-07-10 12:59:32 +02:00
parent 4cda06dcaf
commit 4b9eb9e449
9 changed files with 258 additions and 140 deletions

View File

@ -8,6 +8,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- added option to always auto pick the DefautlBox sandbox [959](https://github.com/sandboxie-plus/Sandboxie/issues/959)
-- when this option is enabled the normal behavioure with a box selection dialog can be achived holding down CTRL
- added option to hide boxed form the run in box dialog
-- usefull to avoidl listing for example insecure compatybility test boxes
- added box options to sys tray [#439](https://github.com/sandboxie-plus/Sandboxie/issues/439) [#272](https://github.com/sandboxie-plus/Sandboxie/issues/272)
### Changed
- changed default terminate all boxed processes key from Ctrl+Break to Ctrl+Alt+Break [#974](https://github.com/sandboxie-plus/Sandboxie/issues/974)
@ -19,6 +22,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed issue with sbiectrl not being properly started after setup [#969](https://github.com/sandboxie-plus/Sandboxie/issues/969)
- fixed issue with explore sandboxed shell option [#972](https://github.com/sandboxie-plus/Sandboxie/issues/972)
- fixed issue when running sandman elevated [#932](https://github.com/sandboxie-plus/Sandboxie/issues/932)
- fixed new box selection dialog showing disabled boxes
- fixed issue updating box active status
### Removed
- removed Online Armor support as this product is deprecated since 2016

View File

@ -1279,8 +1279,8 @@ SB_STATUS CSbieAPI::UpdateProcesses(bool bKeep)
foreach(const CSandBoxPtr& pBox, m_SandBoxes)
{
bool WasBoxClosed = pBox->m_ActiveProcessCount > 0 && count == 0;
pBox->m_ActiveProcessCount = count;
bool WasBoxClosed = pBox->m_ActiveProcessCount > 0 && pBox->GetProcessList().count();
pBox->m_ActiveProcessCount = pBox->GetProcessList().count();
if (WasBoxClosed) {
pBox->CloseBox();
emit BoxClosed(pBox->GetName());

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>660</width>
<height>449</height>
<height>456</height>
</rect>
</property>
<property name="sizePolicy">
@ -45,7 +45,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>6</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
@ -64,13 +64,13 @@
<layout class="QGridLayout" name="gridLayout_27">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_8">
<item row="2" column="7">
<widget class="QLabel" name="label_14">
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="label_20">
<property name="text">
<string>px Width</string>
<string>Sandbox Indicator in title:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@ -84,7 +84,7 @@
</property>
</widget>
</item>
<item row="11" column="2" colspan="5">
<item row="9" column="2" colspan="5">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -97,7 +97,7 @@
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3">
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="label_10">
<property name="font">
<font>
@ -113,17 +113,7 @@
</property>
</widget>
</item>
<item row="9" column="1" colspan="6">
<widget class="QCheckBox" name="chkBlockNetShare">
<property name="text">
<string>Block network files and folders, unless specifically opened.</string>
</property>
</widget>
</item>
<item row="2" column="3" colspan="2">
<widget class="QComboBox" name="cmbBoxBorder"/>
</item>
<item row="4" column="1" colspan="6">
<item row="5" column="1" colspan="6">
<widget class="QLabel" name="label_35">
<property name="font">
<font>
@ -139,75 +129,56 @@
</property>
</widget>
</item>
<item row="8" column="0" colspan="3">
<widget class="QLabel" name="label_34">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Protect the system from sandboxed processes</string>
</property>
<property name="text">
<string>Network restrictions</string>
</property>
</widget>
</item>
<item row="1" column="3" colspan="2">
<widget class="QComboBox" name="cmbBoxIndicator"/>
</item>
<item row="5" column="1" colspan="5">
<item row="6" column="1" colspan="5">
<widget class="QCheckBox" name="chkDropRights">
<property name="text">
<string>Drop rights from Administrators and Power Users groups</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="label_20">
<item row="2" column="7">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Sandbox Indicator in title:</string>
<string>px Width</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="6" colspan="2">
<widget class="QLabel" name="label_40">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>(Recommended)</string>
</property>
</widget>
<item row="2" column="3" colspan="2">
<widget class="QComboBox" name="cmbBoxBorder"/>
</item>
<item row="6" column="2" colspan="6">
<item row="7" column="2" colspan="6">
<widget class="QCheckBox" name="chkFakeElevation">
<property name="text">
<string>Make applications think they are running elevated (allows to run installers safely)</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<item row="2" column="5">
<widget class="QToolButton" name="btnBorderColor">
<property name="text">
<string>Appearance</string>
<string/>
</property>
</widget>
</item>
<item row="9" column="1">
<spacer name="verticalSpacer_17">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_30">
<property name="sizePolicy">
@ -227,30 +198,45 @@
</property>
</widget>
</item>
<item row="11" column="1">
<spacer name="verticalSpacer_17">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="8" column="1" colspan="6">
<widget class="QLabel" name="lblAdmin">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="5">
<widget class="QToolButton" name="btnBorderColor">
<property name="text">
<string/>
<string>CAUTION: When running under the built in administrator, processes can not drop administrative privileges.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="1" colspan="6">
<widget class="QCheckBox" name="chkBlockNetParam">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Prevent change to network and firewall parameters</string>
<string>Appearance</string>
</property>
</widget>
</item>
<item row="6" column="6" colspan="2">
<widget class="QLabel" name="label_40">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>(Recommended)</string>
</property>
</widget>
</item>
@ -267,19 +253,10 @@
</property>
</widget>
</item>
<item row="7" column="1" colspan="6">
<widget class="QLabel" name="lblAdmin">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<item row="3" column="1" colspan="7">
<widget class="QCheckBox" name="chkShowForRun">
<property name="text">
<string>CAUTION: When running under the built in administrator, processes can not drop administrative privileges.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<string>Show this box in the 'run in box' selection prompt</string>
</property>
</widget>
</item>
@ -444,19 +421,19 @@
</widget>
<widget class="QWidget" name="tab_7">
<attribute name="title">
<string>Access Options</string>
<string>Access Restrictions</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_37">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_36">
<item row="6" column="2">
<item row="9" column="2">
<widget class="QCheckBox" name="chkOpenCredentials">
<property name="text">
<string>Open Windows Credentials Store</string>
</property>
</widget>
</item>
<item row="3" column="2">
<item row="6" column="2">
<widget class="QCheckBox" name="chkPrintToFile">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@ -469,14 +446,14 @@
</property>
</widget>
</item>
<item row="2" column="2">
<item row="5" column="2">
<widget class="QCheckBox" name="chkOpenSpooler">
<property name="text">
<string>Remove spooler restriction, printers can be installed outside the sandbox</string>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="11" column="0">
<spacer name="verticalSpacer_12">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -489,21 +466,73 @@
</property>
</spacer>
</item>
<item row="1" column="1" colspan="2">
<widget class="QCheckBox" name="chkBlockSpooler">
<item row="10" column="1" colspan="2">
<widget class="QCheckBox" name="chkCloseClipBoard">
<property name="text">
<string>Block access to the printer spooler</string>
<string>Block read access to the clipboard</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<item row="8" column="1" colspan="2">
<widget class="QCheckBox" name="chkOpenProtectedStorage">
<property name="text">
<string>Open System Protected Storage</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="4" column="1" colspan="2">
<widget class="QCheckBox" name="chkBlockSpooler">
<property name="text">
<string>Block access to the printer spooler</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_18">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Protect the system from sandboxed processes</string>
</property>
<property name="text">
<string>Other restrictions</string>
</property>
</widget>
</item>
<item row="11" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_31">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Protect the system from sandboxed processes</string>
</property>
<property name="text">
<string>Printing restrictions</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_39">
<property name="minimumSize">
<size>
@ -523,7 +552,7 @@
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_31">
<widget class="QLabel" name="label_34">
<property name="font">
<font>
<weight>75</weight>
@ -534,43 +563,21 @@
<string>Protect the system from sandboxed processes</string>
</property>
<property name="text">
<string>Printing restrictions</string>
<string>Network restrictions</string>
</property>
</widget>
</item>
<item row="8" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_18">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Protect the system from sandboxed processes</string>
</property>
<item row="1" column="1" colspan="2">
<widget class="QCheckBox" name="chkBlockNetShare">
<property name="text">
<string>Other restrictions</string>
<string>Block network files and folders, unless specifically opened.</string>
</property>
</widget>
</item>
<item row="7" column="1" colspan="2">
<widget class="QCheckBox" name="chkCloseClipBoard">
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="chkBlockNetParam">
<property name="text">
<string>Block read access to the clipboard</string>
<string>Prevent change to network and firewall parameters</string>
</property>
</widget>
</item>
@ -2095,8 +2102,8 @@ instead of &quot;*&quot;.</string>
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<height>28</height>
<width>63</width>
<height>16</height>
</rect>
</property>
<layout class="QGridLayout" name="dbgLayout">
@ -2426,8 +2433,6 @@ Please note that this values are currently user specific and saved globally for
<tabstop>cmbBoxBorder</tabstop>
<tabstop>btnBorderColor</tabstop>
<tabstop>spinBorderWidth</tabstop>
<tabstop>chkBlockNetShare</tabstop>
<tabstop>chkBlockNetParam</tabstop>
<tabstop>treeRun</tabstop>
<tabstop>btnAddCmd</tabstop>
<tabstop>btnDelCmd</tabstop>

View File

@ -197,10 +197,38 @@ CSandMan::CSandMan(QWidget *parent)
m_bIconDisabled = false;
m_pTrayMenu = new QMenu();
QAction* pShowHide = m_pTrayMenu->addAction(tr("Show/Hide"), this, SLOT(OnShowHide()));
QAction* pShowHide = m_pTrayMenu->addAction(QIcon(":/SandMan.png"), tr("Show/Hide"), this, SLOT(OnShowHide()));
QFont f = pShowHide->font();
f.setBold(true);
pShowHide->setFont(f);
m_pTrayMenu->addSeparator();
QWidgetAction* pTrayList = new QWidgetAction(m_pTrayMenu);
QWidget* pWidget = new CActionWidget();
QHBoxLayout* pLayout = new QHBoxLayout();
pLayout->setMargin(0);
pWidget->setLayout(pLayout);
m_pTrayBoxes = new QTreeWidget();
m_pTrayBoxes->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum);
m_pTrayBoxes->setRootIsDecorated(false);
//m_pTrayBoxes->setHeaderLabels(tr(" Sandbox").split("|"));
m_pTrayBoxes->setHeaderHidden(true);
pLayout->insertSpacing(0, 1);// 32);
pLayout->addWidget(m_pTrayBoxes);
pTrayList->setDefaultWidget(pWidget);
m_pTrayMenu->addAction(pTrayList);
m_pTrayBoxes->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_pTrayBoxes, SIGNAL(customContextMenuRequested( const QPoint& )), this, SLOT(OnBoxMenu(const QPoint &)));
connect(m_pTrayBoxes, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(OnBoxDblClick(QTreeWidgetItem*)));
//m_pBoxMenu
m_pTrayMenu->addSeparator();
m_pTrayMenu->addAction(m_pEmptyAll);
m_pDisableForce2 = m_pTrayMenu->addAction(tr("Disable Forced Programs"), this, SLOT(OnDisableForce2()));
@ -1091,6 +1119,22 @@ void CSandMan::OnNotAuthorized(bool bLoginRequired, bool& bRetry)
LoginOpen = false;
}
void CSandMan::OnBoxMenu(const QPoint & point)
{
QTreeWidgetItem* pItem = m_pTrayBoxes->currentItem();
if (!pItem)
return;
m_pBoxView->PopUpMenu(pItem->data(0, Qt::UserRole).toString());
//m_pBoxMenu->popup(QCursor::pos());
}
void CSandMan::OnBoxDblClick(QTreeWidgetItem* pItem)
{
m_pBoxView->ShowOptions(pItem->data(0, Qt::UserRole).toString());
}
void CSandMan::OnNewBox()
{
m_pBoxView->AddNewBox();
@ -1581,8 +1625,42 @@ void CSandMan::OnSysTray(QSystemTrayIcon::ActivationReason Reason)
switch(Reason)
{
case QSystemTrayIcon::Context:
{
QMap<QString, CSandBoxPtr> Boxes = theAPI->GetAllBoxes();
QMap<QString, QTreeWidgetItem*> OldBoxes;
for(int i = 0; i < m_pTrayBoxes->topLevelItemCount(); ++i)
{
QTreeWidgetItem* pItem = m_pTrayBoxes->topLevelItem(i);
QString Name = pItem->data(0, Qt::UserRole).toString();
OldBoxes.insert(Name,pItem);
}
foreach(const CSandBoxPtr & pBox, Boxes)
{
if (!pBox->IsEnabled())
continue;
CSandBoxPlus* pBoxEx = qobject_cast<CSandBoxPlus*>(pBox.data());
QTreeWidgetItem* pItem = OldBoxes.take(pBox->GetName());
if(!pItem)
{
pItem = new QTreeWidgetItem();
pItem->setData(0, Qt::UserRole, pBox->GetName());
pItem->setText(0, " " + pBox->GetName().replace("_", " "));
m_pTrayBoxes->addTopLevelItem(pItem);
}
pItem->setData(0, Qt::DecorationRole, theGUI->GetBoxIcon(pBox->GetActiveProcessCount(), pBoxEx->GetType()));
}
foreach(QTreeWidgetItem* pItem, OldBoxes)
delete pItem;
m_pTrayMenu->popup(QCursor::pos());
break;
}
case QSystemTrayIcon::DoubleClick:
if (isVisible())
{

View File

@ -131,6 +131,9 @@ public slots:
int ShowQuestion(const QString& question, const QString& checkBoxText, bool* checkBoxSetting, int buttons, int defaultButton);
void OnBoxMenu(const QPoint &);
void OnBoxDblClick(QTreeWidgetItem*);
private slots:
void OnSelectionChanged();
@ -242,6 +245,8 @@ private:
QSystemTrayIcon* m_pTrayIcon;
QMenu* m_pTrayMenu;
QTreeWidget* m_pTrayBoxes;
//QMenu* m_pBoxMenu;
bool m_bIconEmpty;
bool m_bIconDisabled;

View File

@ -970,6 +970,21 @@ void CSbieView::SelectBox(const QString& Name)
QItemSelection SelectedItems;
SelectedItems.append(QItemSelectionRange(ModelL, ModelR));
m_pSbieTree->setCurrentIndex(ModelIndex);
m_pSbieTree->scrollTo(ModelL);
m_pSbieTree->selectionModel()->select(SelectedItems, QItemSelectionModel::ClearAndSelect);
}
void CSbieView::PopUpMenu(const QString& Name)
{
SelectBox(Name);
OnMenu(QCursor::pos());
}
void CSbieView::ShowOptions(const QString& Name)
{
QModelIndex Index = m_pSbieModel->FindIndex(Name);
QModelIndex ModelIndex = m_pSortProxy->mapFromSource(Index);
OnDoubleClicked(ModelIndex);
}

View File

@ -21,6 +21,9 @@ public:
virtual QString AddNewBox();
virtual void SelectBox(const QString& Name);
virtual void PopUpMenu(const QString& Name);
virtual void ShowOptions(const QString& Name);
signals:
void RecoveryRequested(const QString& BoxName);

View File

@ -122,6 +122,7 @@ COptionsWindow::COptionsWindow(const QSharedPointer<CSbieIni>& pBox, const QStri
connect(ui.cmbBoxBorder, SIGNAL(currentIndexChanged(int)), this, SLOT(OnGeneralChanged()));
connect(ui.btnBorderColor, SIGNAL(clicked(bool)), this, SLOT(OnPickColor()));
connect(ui.spinBorderWidth, SIGNAL(valueChanged(int)), this, SLOT(OnGeneralChanged()));
connect(ui.chkShowForRun, SIGNAL(clicked(bool)), this, SLOT(OnGeneralChanged()));
connect(ui.chkBlockNetShare, SIGNAL(clicked(bool)), this, SLOT(OnGeneralChanged()));
connect(ui.chkBlockNetParam, SIGNAL(clicked(bool)), this, SLOT(OnGeneralChanged()));
@ -423,6 +424,8 @@ void COptionsWindow::LoadConfig()
if (!BorderWidth) BorderWidth = 6;
ui.spinBorderWidth->setValue(BorderWidth);
ui.chkShowForRun->setChecked(m_pBox->GetBool("ShowForRunIn", true));
ui.chkBlockNetShare->setChecked(m_pBox->GetBool("BlockNetworkFiles", true));
ui.chkBlockNetParam->setChecked(m_pBox->GetBool("BlockNetParam", true));
ui.chkDropRights->setChecked(m_pBox->GetBool("DropAdminRights", false));
@ -629,6 +632,8 @@ void COptionsWindow::SaveConfig()
BorderCfg.append(QString::number(ui.spinBorderWidth->value()));
WriteText("BorderColor", BorderCfg.join(","));
WriteAdvancedCheck(ui.chkShowForRun, "ShowForRunIn", "", "n");
WriteAdvancedCheck(ui.chkBlockNetShare, "BlockNetworkFiles", "", "n");
WriteAdvancedCheck(ui.chkBlockNetParam, "BlockNetParam", "", "n");
WriteAdvancedCheck(ui.chkDropRights, "DropAdminRights", "y", "");

View File

@ -41,9 +41,11 @@ CSelectBoxWindow::CSelectBoxWindow(const QStringList& Commands, QWidget *parent)
QMap<QString, CSandBoxPtr> Boxes = theAPI->GetAllBoxes();
foreach(const CSandBoxPtr & pBox, Boxes)
{
if (!pBox->IsEnabled() || !pBox->GetBool("ShowForRunIn", true))
continue;
CSandBoxPlus* pBoxEx = qobject_cast<CSandBoxPlus*>(pBox.data());
QTreeWidgetItem* pItem = new QTreeWidgetItem();