|
|
|
|
@@ -1,24 +1,23 @@
|
|
|
|
|
From cadbae12c08d7031c83a7af04bed4b8f8a517382 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From fd06cccb9ff5b8e4099a78a795503eb052d506d6 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Christophe Marin <christophe@krop.fr>
|
|
|
|
|
Date: Thu, 15 Feb 2024 19:16:54 +0100
|
|
|
|
|
Subject: [PATCH] Don't require password when changing settings
|
|
|
|
|
|
|
|
|
|
See https://bugzilla.suse.com/show_bug.cgi?id=1217190
|
|
|
|
|
The kauth helper is useless and doesn't improve security.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
CMakeLists.txt | 8 ++++----
|
|
|
|
|
src/CMakeLists.txt | 4 ++--
|
|
|
|
|
src/konfigurator/CMakeLists.txt | 32 ++++++++++++++++---------------
|
|
|
|
|
src/konfigurator/konfigurator.cpp | 29 ----------------------------
|
|
|
|
|
src/konfigurator/konfigurator.h | 1 -
|
|
|
|
|
5 files changed, 23 insertions(+), 51 deletions(-)
|
|
|
|
|
CMakeLists.txt | 5 ---
|
|
|
|
|
src/CMakeLists.txt | 4 +--
|
|
|
|
|
src/konfigurator/CMakeLists.txt | 32 ++++++++++---------
|
|
|
|
|
src/konfigurator/konfigurator.cpp | 53 ++++++++-----------------------
|
|
|
|
|
src/konfigurator/konfigurator.h | 15 ++++-----
|
|
|
|
|
5 files changed, 37 insertions(+), 72 deletions(-)
|
|
|
|
|
|
|
|
|
|
Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/CMakeLists.txt
|
|
|
|
|
===================================================================
|
|
|
|
|
--- kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965.orig/CMakeLists.txt
|
|
|
|
|
+++ kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/CMakeLists.txt
|
|
|
|
|
@@ -35,10 +35,10 @@ ecm_setup_version(${RELEASE_SERVICE_VERS
|
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
|
|
|
index 059b0f1c..3d3eafae 100644
|
|
|
|
|
--- a/CMakeLists.txt
|
|
|
|
|
+++ b/CMakeLists.txt
|
|
|
|
|
@@ -37,11 +37,6 @@ ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KWALLETMANAGER
|
|
|
|
|
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/kwalletmanager_version.h"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@@ -26,29 +25,25 @@ Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/CMakeLists.tx
|
|
|
|
|
-if (ENABLE_KAUTH)
|
|
|
|
|
- find_package(KF6 ${KF_MIN_VERSION} REQUIRED Auth)
|
|
|
|
|
-endif()
|
|
|
|
|
+# option(ENABLE_KAUTH "Enable KAuth support (Disabled for Flatpak builds)" ON)
|
|
|
|
|
+# if (ENABLE_KAUTH)
|
|
|
|
|
+# find_package(KF6 ${KF_MIN_VERSION} REQUIRED Auth)
|
|
|
|
|
+# endif()
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
find_package(KF6 ${KF_MIN_VERSION} REQUIRED
|
|
|
|
|
Archive
|
|
|
|
|
Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/CMakeLists.txt
|
|
|
|
|
===================================================================
|
|
|
|
|
--- kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965.orig/src/CMakeLists.txt
|
|
|
|
|
+++ kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/CMakeLists.txt
|
|
|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
|
Config
|
|
|
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
|
|
|
index 69ff4807..bc9fa218 100644
|
|
|
|
|
--- a/src/CMakeLists.txt
|
|
|
|
|
+++ b/src/CMakeLists.txt
|
|
|
|
|
@@ -1,4 +1,2 @@
|
|
|
|
|
-if (ENABLE_KAUTH)
|
|
|
|
|
+# if (ENABLE_KAUTH)
|
|
|
|
|
add_subdirectory(konfigurator)
|
|
|
|
|
- add_subdirectory(konfigurator)
|
|
|
|
|
-endif()
|
|
|
|
|
+# endif()
|
|
|
|
|
+add_subdirectory(konfigurator)
|
|
|
|
|
add_subdirectory(manager)
|
|
|
|
|
Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigurator/CMakeLists.txt
|
|
|
|
|
===================================================================
|
|
|
|
|
--- kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965.orig/src/konfigurator/CMakeLists.txt
|
|
|
|
|
+++ kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigurator/CMakeLists.txt
|
|
|
|
|
@@ -10,7 +10,6 @@ ki18n_wrap_ui(kcm_kwallet5 walletconfigw
|
|
|
|
|
diff --git a/src/konfigurator/CMakeLists.txt b/src/konfigurator/CMakeLists.txt
|
|
|
|
|
index cba75123..778ebcd9 100644
|
|
|
|
|
--- a/src/konfigurator/CMakeLists.txt
|
|
|
|
|
+++ b/src/konfigurator/CMakeLists.txt
|
|
|
|
|
@@ -10,7 +10,6 @@ ki18n_wrap_ui(kcm_kwallet5 walletconfigwidget.ui )
|
|
|
|
|
|
|
|
|
|
target_link_libraries(kcm_kwallet5
|
|
|
|
|
Qt6::Core
|
|
|
|
|
@@ -63,15 +58,20 @@ Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigura
|
|
|
|
|
-########### kauth helper ################
|
|
|
|
|
-add_executable(kcm_kwallet_helper5)
|
|
|
|
|
-target_sources(kcm_kwallet_helper5 PRIVATE savehelper.cpp savehelper.h)
|
|
|
|
|
+# The helper is not improving security and was disabled.
|
|
|
|
|
+# See https://bugzilla.suse.com/show_bug.cgi?id=1217190
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-target_link_libraries(kcm_kwallet_helper5
|
|
|
|
|
- Qt6::Core
|
|
|
|
|
- KF6::AuthCore
|
|
|
|
|
- KF6::Wallet
|
|
|
|
|
- KF6::CoreAddons
|
|
|
|
|
-)
|
|
|
|
|
+# The helper is not improving security and was disabled.
|
|
|
|
|
+# See https://bugzilla.suse.com/show_bug.cgi?id=1217190
|
|
|
|
|
|
|
|
|
|
-install(TARGETS kcm_kwallet_helper5 DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
|
|
|
|
|
-
|
|
|
|
|
-kauth_install_helper_files(kcm_kwallet_helper5 org.kde.kcontrol.kcmkwallet5 root)
|
|
|
|
|
-kauth_install_actions(org.kde.kcontrol.kcmkwallet5 kwallet.actions)
|
|
|
|
|
+########### kauth helper ################
|
|
|
|
|
+# add_executable(kcm_kwallet_helper5)
|
|
|
|
|
+# target_sources(kcm_kwallet_helper5 PRIVATE savehelper.cpp savehelper.h)
|
|
|
|
|
@@ -82,30 +82,32 @@ Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigura
|
|
|
|
|
+# KF6::Wallet
|
|
|
|
|
+# KF6::CoreAddons
|
|
|
|
|
+# )
|
|
|
|
|
|
|
|
|
|
-install(TARGETS kcm_kwallet_helper5 DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
|
|
|
|
|
+
|
|
|
|
|
+# install(TARGETS kcm_kwallet_helper5 DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
|
|
|
|
|
|
|
|
|
|
-kauth_install_helper_files(kcm_kwallet_helper5 org.kde.kcontrol.kcmkwallet5 root)
|
|
|
|
|
-kauth_install_actions(org.kde.kcontrol.kcmkwallet5 kwallet.actions)
|
|
|
|
|
+
|
|
|
|
|
+# kauth_install_helper_files(kcm_kwallet_helper5 org.kde.kcontrol.kcmkwallet5 root)
|
|
|
|
|
+# kauth_install_actions(org.kde.kcontrol.kcmkwallet5 kwallet.actions)
|
|
|
|
|
|
|
|
|
|
Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigurator/konfigurator.cpp
|
|
|
|
|
===================================================================
|
|
|
|
|
--- kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965.orig/src/konfigurator/konfigurator.cpp
|
|
|
|
|
+++ kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigurator/konfigurator.cpp
|
|
|
|
|
@@ -7,9 +7,6 @@
|
|
|
|
|
diff --git a/src/konfigurator/konfigurator.cpp b/src/konfigurator/konfigurator.cpp
|
|
|
|
|
index 36ad4b9a..c7bdccb4 100644
|
|
|
|
|
--- a/src/konfigurator/konfigurator.cpp
|
|
|
|
|
+++ b/src/konfigurator/konfigurator.cpp
|
|
|
|
|
@@ -7,8 +7,6 @@
|
|
|
|
|
#include "konfigurator.h"
|
|
|
|
|
#include "../kwalletmanager_version.h"
|
|
|
|
|
|
|
|
|
|
-#include <KAuth/Action>
|
|
|
|
|
-#include <KAuth/ActionReply>
|
|
|
|
|
-#include <KAuth/ExecuteJob>
|
|
|
|
|
#include <KConfigGroup>
|
|
|
|
|
#include <KMessageBox>
|
|
|
|
|
#include <KPluginFactory>
|
|
|
|
|
@@ -38,7 +35,6 @@ KWalletConfig::KWalletConfig(QObject *pa
|
|
|
|
|
@@ -32,12 +30,11 @@
|
|
|
|
|
|
|
|
|
|
K_PLUGIN_CLASS_WITH_JSON(KWalletConfig, "kwalletconfig.json")
|
|
|
|
|
|
|
|
|
|
-KWalletConfig::KWalletConfig(QObject *parent, const KPluginMetaData &data)
|
|
|
|
|
+KWalletConfig::KWalletConfig(QObject* parent, const KPluginMetaData& data)
|
|
|
|
|
: KCModule(parent, data)
|
|
|
|
|
, _wcw(new WalletConfigWidget(widget()))
|
|
|
|
|
, _cfg(KSharedConfig::openConfig(QStringLiteral("kwalletrc"), KConfig::NoGlobals))
|
|
|
|
|
{
|
|
|
|
|
@@ -113,7 +115,32 @@ Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigura
|
|
|
|
|
auto vbox = new QVBoxLayout(widget());
|
|
|
|
|
vbox->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
vbox->addWidget(_wcw);
|
|
|
|
|
@@ -233,30 +229,6 @@ void KWalletConfig::load()
|
|
|
|
|
@@ -59,11 +56,11 @@ KWalletConfig::KWalletConfig(QObject *parent, const KPluginMetaData &data)
|
|
|
|
|
connect(_wcw->_accessList, &QTreeWidget::customContextMenuRequested, this, &KWalletConfig::customContextMenuRequested);
|
|
|
|
|
connect(_wcw->_secretServiceAPI, &QCheckBox::clicked, this, &KWalletConfig::configChanged);
|
|
|
|
|
|
|
|
|
|
- QStyle *style = widget()->style();
|
|
|
|
|
+ QStyle* style = widget()->style();
|
|
|
|
|
_wcw->launchButtonBar->setContentsMargins(style->pixelMetric(QStyle::PM_LayoutLeftMargin),
|
|
|
|
|
- 0,
|
|
|
|
|
- style->pixelMetric(QStyle::PM_LayoutRightMargin),
|
|
|
|
|
- style->pixelMetric(QStyle::PM_LayoutBottomMargin));
|
|
|
|
|
+ 0,
|
|
|
|
|
+ style->pixelMetric(QStyle::PM_LayoutRightMargin),
|
|
|
|
|
+ style->pixelMetric(QStyle::PM_LayoutBottomMargin));
|
|
|
|
|
|
|
|
|
|
_wcw->_accessList->setAllColumnsShowFocus(true);
|
|
|
|
|
_wcw->_accessList->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
|
@@ -107,7 +104,7 @@ QString KWalletConfig::newWallet()
|
|
|
|
|
if (!ok) {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
- KWallet::Wallet *w = KWallet::Wallet::openWallet(n, widget()->topLevelWidget()->winId());
|
|
|
|
|
+ KWallet::Wallet* w = KWallet::Wallet::openWallet(n, widget()->topLevelWidget()->winId());
|
|
|
|
|
if (!w) {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
@@ -239,30 +236,6 @@ void KWalletConfig::load()
|
|
|
|
|
|
|
|
|
|
void KWalletConfig::save()
|
|
|
|
|
{
|
|
|
|
|
@@ -144,11 +171,58 @@ Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigura
|
|
|
|
|
KConfigGroup config(_cfg, QStringLiteral("Wallet"));
|
|
|
|
|
config.writeEntry("Enabled", _wcw->_enabled->isChecked());
|
|
|
|
|
config.writeEntry("Launch Manager", _wcw->_launchManager->isChecked());
|
|
|
|
|
Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigurator/konfigurator.h
|
|
|
|
|
===================================================================
|
|
|
|
|
--- kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965.orig/src/konfigurator/konfigurator.h
|
|
|
|
|
+++ kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigurator/konfigurator.h
|
|
|
|
|
@@ -7,7 +7,6 @@
|
|
|
|
|
@@ -291,10 +264,10 @@ void KWalletConfig::save()
|
|
|
|
|
_cfg->deleteGroup(QStringLiteral("Auto Deny"));
|
|
|
|
|
config = _cfg->group(QStringLiteral("Auto Allow"));
|
|
|
|
|
for (int i = 0; i < _wcw->_accessList->topLevelItemCount(); ++i) {
|
|
|
|
|
- QTreeWidgetItem *parentItem = _wcw->_accessList->topLevelItem(i);
|
|
|
|
|
+ QTreeWidgetItem* parentItem = _wcw->_accessList->topLevelItem(i);
|
|
|
|
|
QStringList al;
|
|
|
|
|
for (int j = 0; j < parentItem->childCount(); ++j) {
|
|
|
|
|
- QTreeWidgetItem *childItem = parentItem->child(j);
|
|
|
|
|
+ QTreeWidgetItem* childItem = parentItem->child(j);
|
|
|
|
|
if (childItem->text(2) == i18n("Always Allow")) {
|
|
|
|
|
al << childItem->text(1);
|
|
|
|
|
}
|
|
|
|
|
@@ -304,10 +277,10 @@ void KWalletConfig::save()
|
|
|
|
|
|
|
|
|
|
config = _cfg->group(QStringLiteral("Auto Deny"));
|
|
|
|
|
for (int i = 0; i < _wcw->_accessList->topLevelItemCount(); ++i) {
|
|
|
|
|
- QTreeWidgetItem *parentItem = _wcw->_accessList->topLevelItem(i);
|
|
|
|
|
+ QTreeWidgetItem* parentItem = _wcw->_accessList->topLevelItem(i);
|
|
|
|
|
QStringList al;
|
|
|
|
|
for (int j = 0; j < parentItem->childCount(); ++j) {
|
|
|
|
|
- QTreeWidgetItem *childItem = parentItem->child(j);
|
|
|
|
|
+ QTreeWidgetItem* childItem = parentItem->child(j);
|
|
|
|
|
if (childItem->text(2) == i18n("Always Deny")) {
|
|
|
|
|
al << childItem->text(1);
|
|
|
|
|
}
|
|
|
|
|
@@ -349,9 +322,9 @@ void KWalletConfig::defaults()
|
|
|
|
|
setNeedsSave(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-void KWalletConfig::customContextMenuRequested(const QPoint &pos)
|
|
|
|
|
+void KWalletConfig::customContextMenuRequested(const QPoint& pos)
|
|
|
|
|
{
|
|
|
|
|
- QTreeWidgetItem *item = _wcw->_accessList->itemAt(pos);
|
|
|
|
|
+ QTreeWidgetItem* item = _wcw->_accessList->itemAt(pos);
|
|
|
|
|
if (item && item->parent()) {
|
|
|
|
|
auto m = new QMenu(widget());
|
|
|
|
|
m->setTitle(item->parent()->text(0));
|
|
|
|
|
@@ -363,7 +336,7 @@ void KWalletConfig::customContextMenuRequested(const QPoint &pos)
|
|
|
|
|
|
|
|
|
|
void KWalletConfig::deleteEntry()
|
|
|
|
|
{
|
|
|
|
|
- QList<QTreeWidgetItem *> items = _wcw->_accessList->selectedItems();
|
|
|
|
|
+ QList<QTreeWidgetItem*> items = _wcw->_accessList->selectedItems();
|
|
|
|
|
if (items.count() == 1 && items[0]) {
|
|
|
|
|
delete items[0];
|
|
|
|
|
setNeedsSave(true);
|
|
|
|
|
diff --git a/src/konfigurator/konfigurator.h b/src/konfigurator/konfigurator.h
|
|
|
|
|
index fa508c1b..461a79bd 100644
|
|
|
|
|
--- a/src/konfigurator/konfigurator.h
|
|
|
|
|
+++ b/src/konfigurator/konfigurator.h
|
|
|
|
|
@@ -7,25 +7,22 @@
|
|
|
|
|
#ifndef _KWALLETKONFIGURATOR_H
|
|
|
|
|
#define _KWALLETKONFIGURATOR_H
|
|
|
|
|
#include "ui_walletconfigwidget.h"
|
|
|
|
|
@@ -156,3 +230,42 @@ Index: kwalletmanager-%{_kapp6_version}git.20240513T064813~17ce965/src/konfigura
|
|
|
|
|
#include <KCModule>
|
|
|
|
|
#include <KSharedConfig>
|
|
|
|
|
|
|
|
|
|
-class WalletConfigWidget : public QWidget, public Ui::WalletConfigWidget
|
|
|
|
|
-{
|
|
|
|
|
+class WalletConfigWidget : public QWidget, public Ui::WalletConfigWidget {
|
|
|
|
|
public:
|
|
|
|
|
- WalletConfigWidget(QWidget *parent)
|
|
|
|
|
+ WalletConfigWidget(QWidget* parent)
|
|
|
|
|
: QWidget(parent)
|
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
-class KWalletConfig : public KCModule
|
|
|
|
|
-{
|
|
|
|
|
+class KWalletConfig : public KCModule {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
- explicit KWalletConfig(QObject *parent, const KPluginMetaData &data);
|
|
|
|
|
+ explicit KWalletConfig(QObject* parent, const KPluginMetaData& data);
|
|
|
|
|
~KWalletConfig() override;
|
|
|
|
|
|
|
|
|
|
void load() override;
|
|
|
|
|
@@ -39,11 +36,11 @@ public Q_SLOTS:
|
|
|
|
|
void newNetworkWallet();
|
|
|
|
|
void updateWalletLists();
|
|
|
|
|
void deleteEntry();
|
|
|
|
|
- void customContextMenuRequested(const QPoint &pos);
|
|
|
|
|
+ void customContextMenuRequested(const QPoint& pos);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString newWallet();
|
|
|
|
|
- WalletConfigWidget *const _wcw;
|
|
|
|
|
+ WalletConfigWidget* const _wcw;
|
|
|
|
|
KSharedConfig::Ptr _cfg;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
2.51.0
|
|
|
|
|
|
|
|
|
|
|