Christophe Marin 2023-03-20 08:51:36 +00:00 committed by Git OBS Bridge
parent 8ec36a9f9f
commit 15f4c7c2b4
7 changed files with 58 additions and 70 deletions

View File

@ -1,6 +1,6 @@
From 52f948fe211fedc54c13c0baf067cd6d8e4cb0c3 Mon Sep 17 00:00:00 2001
From f1b20995d1fe309b32b090ef8667f2de2f1d9d02 Mon Sep 17 00:00:00 2001
From: Luca Beltrame <lbeltrame@kde.org>
Date: Sun, 3 Apr 2022 09:26:48 +0200
Date: Sun, 26 Feb 2023 22:27:06 +0100
Subject: [PATCH] Defuse root block
While the main point is correct as any application running in the same
@ -8,59 +8,39 @@ X session (not sandboxed) can use kate's capability to open a console,
we allow (even encourage) running YaST on X11 as root.
That way it's only an impact on usability.
---
apps/kate/main.cpp | 15 ++-------------
apps/kwrite/main.cpp | 17 +++--------------
2 files changed, 5 insertions(+), 27 deletions(-)
apps/lib/kateapp.cpp | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
Index: kate-19.11.70git.20220404T014944~1f6e53f72/apps/kate/main.cpp
===================================================================
--- kate-19.11.70git.20220404T014944~1f6e53f72.orig/apps/kate/main.cpp 2022-04-04 03:49:44.000000000 +0200
+++ kate-19.11.70git.20220404T014944~1f6e53f72/apps/kate/main.cpp 2022-04-04 05:55:46.476883480 +0200
@@ -49,19 +49,8 @@
diff --git a/apps/lib/kateapp.cpp b/apps/lib/kateapp.cpp
index 2d1a66157..85079c356 100644
--- a/apps/lib/kateapp.cpp
+++ b/apps/lib/kateapp.cpp
@@ -87,23 +87,8 @@ void KateApp::initPreApplicationCreation()
#if !defined(Q_OS_WIN) && !defined(Q_OS_HAIKU)
// Prohibit using sudo or kdesu (but allow using the root user directly)
if (getuid() == 0) {
- setlocale(LC_ALL, "");
- bindtextdomain("kate", KDE_INSTALL_FULL_LOCALEDIR);
- if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
- std::cout << "Running Kate with sudo can cause bugs and expose you to security vulnerabilities. "
- "Instead use Kate normally and you will be prompted for elevated privileges when "
- "saving documents if needed."
- << std::endl;
- return EXIT_FAILURE;
- auto message = kli18n(
- "Running this editor with sudo can cause bugs and expose you to security vulnerabilities. "
- "Instead use this editor normally and you will be prompted for elevated privileges when "
- "saving documents if needed.");
- std::cout << dgettext("kate", message.untranslatedText()) << std::endl;
- exit(EXIT_FAILURE);
- } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
- std::cout << "Running Kate with kdesu can cause bugs and expose you to security vulnerabilities. "
- "Instead use Kate normally and you will be prompted for elevated privileges when "
- "saving documents if needed."
- << std::endl;
- return EXIT_FAILURE;
- }
+ std::cout << "THIS IS POTENTIALLY INSECURE!\nTo edit files as root please use:" << std::endl;
+ std::cout << "SUDO_EDITOR=kate sudoedit <file>" << std::endl;
}
#endif
/**
Index: kate-19.11.70git.20220404T014944~1f6e53f72/apps/kwrite/main.cpp
===================================================================
--- kate-19.11.70git.20220404T014944~1f6e53f72.orig/apps/kwrite/main.cpp 2022-04-04 03:49:44.000000000 +0200
+++ kate-19.11.70git.20220404T014944~1f6e53f72/apps/kwrite/main.cpp 2022-04-04 05:57:17.276197192 +0200
@@ -27,19 +27,8 @@
#if !defined(Q_OS_WIN) && !defined(Q_OS_HAIKU)
// Prohibit using sudo or kdesu (but allow using the root user directly)
if (getuid() == 0) {
- if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
- std::cout << "Running KWrite with sudo can cause bugs and expose you to security vulnerabilities. "
- "Instead use KWrite normally and you will be prompted for elevated privileges when "
- "saving documents if needed."
- << std::endl;
- return EXIT_FAILURE;
- } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
- std::cout << "Running KWrite with kdesu can cause bugs and expose you to security vulnerabilities. "
- "Instead use KWrite normally and you will be prompted for elevated privileges when "
- "saving documents if needed."
- << std::endl;
- return EXIT_FAILURE;
- auto message = kli18n(
- "Running this editor with kdesu can cause bugs and expose you to security vulnerabilities. "
- "Instead use this editor normally and you will be prompted for elevated privileges when "
- "saving documents if needed.");
- std::cout << dgettext("kate", message.untranslatedText()) << std::endl;
- exit(EXIT_FAILURE);
- }
+ std::cout << "THIS IS POTENTIALLY INSECURE!\nTo edit files as root please use:" << std::endl;
+ std::cout << "SUDO_EDITOR=kwrite sudoedit <file>" << std::endl;
}
#endif
--
2.39.2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5bfb05b8dad0c3c7301da0a1998d41de7acf0ec18f40912a59b3e855188f443e
size 7888764

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE2BwMs463Je9mkcOFu0YzUNbvMe8FAmP9RHcACgkQu0YzUNbv
Me/SGBAAlrrI7IBg45lfI1KN6IzgPeltxarTCDlkaNljLWn1QOLpc0zwBG9DSKbY
8sH4FhZJQuJ84DxDYF8RPb5QNSJPjWHNu2tmwEe1ZEC6R6u2XsRIr91KgWHCdgeU
nlhNxrn1HkzvIUbwZzbGkSvE+oCawIS7dwFtNP6UW0KkYdaNVv3Z+SzUtb9PNag+
Sq+8YTlhDUwl7PjwaR4Xs89gjvsYxUuLMt/SsT7fM5Z7BEOWmBeH+KoYNkyXAbE2
4oDlmr+kmUnzX3uwQEOPGYnABDqxLHVuF3IhuV/dvVCS90nNl0g+E8cwn4o+X4w9
2fRIcc/bbWebn/JyvWSgiHEl+CKnripOrmKZUPLs3oLMsDn6C21LIAVZKN6VF1eE
ymQQASmdi4MlsKID+6/YU/yAF+tMPPxp4xRq1/SR09aDUlsHpL1ImzfQzppTdlTx
6uC60Sv089Iq5skLhppTOXVudgx/4V5zfNkSMbYPQRLA1+vtGT6SyieEjW5PWir5
neeypmvIShJvfPoREEHdlfDzuWihS6MBzfAhAlBneknSztmLjulunyelczCbHIo2
FY0oWiRyMBpAav9ZdNG7Ul7o801MGdfx9A/CYoQ1xtL483HK5cmwtqeV3oYmmUPK
nmCNMa61xirhWDVseihzNk9XuPMXAQ1XhVAp0rbgEvepO4y5Q7c=
=GIjr
-----END PGP SIGNATURE-----

3
kate-23.03.80.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0342867512b06759676981833a1b02e9b3d84e2530851dfd46599c961d4ad9a8
size 7978364

16
kate-23.03.80.tar.xz.sig Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEyiYsbIPeTS+yijMqOmpNuDnqptcFAmQUGqwACgkQOmpNuDnq
ptfkVBAAiEnHujpIkO4Ey1RJtq8kf8DYJyoWbbVekWglDB1ABEuocgc64tequdoC
70fKM771Xa1O+Khho3ig0ZRvkZlN2EbhGwFRriIwLPKxg6vpjoTSNlDRsLUPLxGq
Rr/4ki3jWd1Wo/OwpS502okiK6RqJjYBN6SQ5c/sQbG5aHylh7jfPoi/WrUVite8
ZaY8voASyHAMBp4WV9HxZMlIjU37kBEQxeZWX1AvDligG3NJwt/eoAhMpaODfP39
R8gZm1M4GHPyPwgDRgnLEVzawl4qsbAOlXfKfQhlqZEgSPZrWngTSQtRFVmIRrtx
ZRe076z2LdypLevkmr+2IXifRKXSls4mmhxDtJRskQlWVKRdMlkUzQr3K57jAxMr
4wlOnrSu2haKQcKRSUAdPe5LFIabTBOM53WXrDEwQ+BwZ7qdXq1zCvNa+oXyTKGg
gK948MW6CGJoEVqrMicnUodfRad76rFjZm8xnzQbqG7/FaZpv/Z32QePGy9YTm5E
oaX9vmr8SCIdjASGWSmexFu6RhZahaSmMyjlKTVkTxZZiGGZWesMcJ3dZ+ZQT6VI
JnezdddYYVLCobTBLyv94ery4D4+/2gjm7Et7CATNLwHXdv2A3aSNewqji1kw6sd
OwGo+ymFCgBKW/yI++5dy/CACtB+/zYeh1ELkrJGy/50COaEdAs=
=LM9a
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Mar 17 20:43:11 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 23.03.80
* New feature release
- Rebase patch:
* 0001-Defuse-root-block.patch
-------------------------------------------------------------------
Thu Mar 16 08:55:23 UTC 2023 - Christophe Marin <christophe@krop.fr>

View File

@ -17,18 +17,16 @@
%define _appstreamkpackage 0%(cat %{_kf5_cmakedir}/KF5Package/KF5PackageMacros.cmake | grep -q 'appstream-metainfo' && echo 1)
# Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA)
%{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
%bcond_without released
Name: kate
Version: 22.12.3
Version: 23.03.80
Release: 0
Summary: Advanced Text Editor
License: GPL-3.0-or-later
URL: https://kate-editor.org
Source: https://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz
Source: https://download.kde.org/unstable/release-service/%{version}/src/%{name}-%{version}.tar.xz
%if %{with released}
Source1: https://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz.sig
Source1: https://download.kde.org/unstable/release-service/%{version}/src/%{name}-%{version}.tar.xz.sig
Source2: applications.keyring
%endif
# PATCH-FIX-OPENSUSE
@ -48,6 +46,7 @@ BuildRequires: cmake(KF5KIO)
BuildRequires: cmake(KF5NewStuff)
BuildRequires: cmake(KF5Parts)
BuildRequires: cmake(KF5Plasma)
BuildRequires: cmake(KF5Pty)
BuildRequires: cmake(KF5Service)
BuildRequires: cmake(KF5SyntaxHighlighting)
BuildRequires: cmake(KF5TextEditor)
@ -60,6 +59,7 @@ BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5DBus)
BuildRequires: cmake(Qt5Script)
BuildRequires: cmake(Qt5Sql)
BuildRequires: cmake(Qt5X11Extras)
BuildRequires: cmake(Qt5Test)
BuildRequires: cmake(Qt5Widgets)
%if 0%{?suse_version} <= 1500