mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-05 18:15:47 +00:00
fix security hole in helper
This commit is contained in:
@ -437,6 +437,10 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
|
||||
|
||||
createObjects();
|
||||
if (useHelper) useHelper = isHelperActive();
|
||||
if (useHelper)
|
||||
sendDBusRequest(DBUS_HELPER_SERVICE, DBUS_CTRL_PATH,
|
||||
DBUS_HELPER_INTERFACE, QString("Update"),
|
||||
QList<QVariant>(), true, debug);
|
||||
setTab(args[QString("tab")].toInt() - 1);
|
||||
createActions();
|
||||
setIconsToTabs();
|
||||
|
@ -322,6 +322,7 @@ QMap<QString, QString> SettingsWindow::readSettings()
|
||||
else
|
||||
settings[QString("FORCE_SUDO")] = QString("false");
|
||||
settings[QString("HELPER_PATH")] = ui->lineEdit_helperPath->text();
|
||||
settings[QString("HELPER_SERVICE")] = ui->lineEdit_helperService->text();
|
||||
settings[QString("IFACE_DIR")] = ui->lineEdit_interfacesDir->text();
|
||||
settings[QString("LANGUAGE")] = ui->comboBox_language->currentText();
|
||||
settings[QString("NETCTL_PATH")] = ui->lineEdit_netctlPath->text();
|
||||
@ -375,6 +376,7 @@ void SettingsWindow::setSettings(const QMap<QString, QString> settings)
|
||||
else
|
||||
ui->checkBox_forceSudo->setCheckState(Qt::Unchecked);
|
||||
ui->lineEdit_helperPath->setText(settings[QString("HELPER_PATH")]);
|
||||
ui->lineEdit_helperPath->setText(settings[QString("HELPER_SERVICE")]);
|
||||
ui->lineEdit_interfacesDir->setText(settings[QString("IFACE_DIR")]);
|
||||
ui->comboBox_language->setCurrentIndex(0);
|
||||
for (int i=0; i<ui->comboBox_language->count(); i++)
|
||||
@ -421,6 +423,7 @@ QMap<QString, QString> SettingsWindow::getDefault()
|
||||
settings[QString("CTRL_GROUP")] = QString("users");
|
||||
settings[QString("FORCE_SUDO")] = QString("false");
|
||||
settings[QString("HELPER_PATH")] = QString("/usr/bin/netctlgui-helper");
|
||||
settings[QString("HELPER_SERVICE")] = QString("netctlgui-helper.service");
|
||||
settings[QString("IFACE_DIR")] = QString("/sys/class/net/");
|
||||
settings[QString("LANGUAGE")] = QString("en");
|
||||
settings[QString("NETCTL_PATH")] = QString("/usr/bin/netctl");
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>658</width>
|
||||
<height>319</height>
|
||||
<width>656</width>
|
||||
<height>317</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -119,7 +119,7 @@
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_general">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
@ -136,8 +136,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>442</width>
|
||||
<height>258</height>
|
||||
<width>440</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
@ -211,8 +211,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>442</width>
|
||||
<height>258</height>
|
||||
<width>440</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
@ -220,6 +220,12 @@
|
||||
<layout class="QHBoxLayout" name="layout_status">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_statusText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Helper status</string>
|
||||
</property>
|
||||
@ -251,7 +257,9 @@
|
||||
<string>Start</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="system-run"/>
|
||||
<iconset theme="system-run">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -282,6 +290,12 @@
|
||||
<layout class="QHBoxLayout" name="layout_helperPath">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_helperPath">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Helper command</string>
|
||||
</property>
|
||||
@ -299,6 +313,30 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_helperService">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_helperService">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Helper service</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_helperService">
|
||||
<property name="toolTip">
|
||||
<string>Name of netctlgui-helper service</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_helper">
|
||||
<property name="orientation">
|
||||
@ -333,8 +371,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>436</width>
|
||||
<height>165</height>
|
||||
<width>440</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
|
Reference in New Issue
Block a user