From a03d1eddb4c529c8e967cfc1e33a89605e5f02c3 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sat, 26 Jan 2019 00:51:48 -0600 Subject: [PATCH] Remove reverse-applicable patches. --- debian/changelog | 5 +- debian/patches/fix-layout-line-break.patch | 46 -------------- debian/patches/series | 2 - debian/patches/sudo-strip-environment.patch | 69 --------------------- 4 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 debian/patches/fix-layout-line-break.patch delete mode 100644 debian/patches/series delete mode 100644 debian/patches/sudo-strip-environment.patch diff --git a/debian/changelog b/debian/changelog index 5cc0c1e..3f42d4b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,8 @@ lxqt-sudo (0.14.0-0ubuntu1) UNRELEASED; urgency=medium - [ apt-ghetto ] - * Leave only required variables to get into the elevated child process. - - [ Simon Quigley ] * New upstream release. - Bump build dependencies. + - Remove reverse-applicable patches. * Bump Standards-version to 4.3.0, no changes needed. * Bump debhelper compat to 12, no changes needed. diff --git a/debian/patches/fix-layout-line-break.patch b/debian/patches/fix-layout-line-break.patch deleted file mode 100644 index d8e2a8c..0000000 --- a/debian/patches/fix-layout-line-break.patch +++ /dev/null @@ -1,46 +0,0 @@ -Description: Fix the layout and line break - In some cases, text was being cut off from the prompt and was not visible. -Author: Tsu Jan -Origin: upstream -Bug: https://github.com/lxqt/lxqt/issues/1505 -Applied-Upstream: commit:01c23a5 -Last-Update: 2018-08-20 ---- a/passworddialog.cpp -+++ b/passworddialog.cpp -@@ -41,7 +41,7 @@ PasswordDialog::PasswordDialog(QStringLi - QString cmd; - if (0 < argv.size()) - cmd = argv[0]; -- ui->descriptionL->setText(tr("%1 needs administrative privileges.\nPlease enter your password.").arg(cmd)); -+ ui->descriptionL->setText(tr("%1 needs administrative privileges.
Please enter your password.").arg(cmd)); - ui->iconL->setPixmap(QIcon::fromTheme("dialog-password").pixmap(64, 64)); - setWindowIcon(QIcon::fromTheme("security-high")); - } ---- a/passworddialog.ui -+++ b/passworddialog.ui -@@ -10,12 +10,6 @@ - 200 - - -- -- -- 0 -- 0 -- -- - - LXQt sudo - -@@ -31,6 +25,12 @@ - - - -+ -+ -+ 0 -+ 0 -+ -+ - - - diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 1fbd884..0000000 --- a/debian/patches/series +++ /dev/null @@ -1,2 +0,0 @@ -fix-layout-line-break.patch -sudo-strip-environment.patch diff --git a/debian/patches/sudo-strip-environment.patch b/debian/patches/sudo-strip-environment.patch deleted file mode 100644 index 2652c4b..0000000 --- a/debian/patches/sudo-strip-environment.patch +++ /dev/null @@ -1,69 +0,0 @@ -Description: Sudo: Strip environment - Leave only required environment variables (for X & locale) to get into the elevated child process. -Author: Palo Kisa -Applied-Upstream: https://github.com/lxqt/lxqt-sudo/commit/07ec9ec14e5d8ff2fe5aba33d9f0a1cd07a4db60 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/sudo.cpp -+++ b/sudo.cpp -@@ -36,12 +36,14 @@ - #include - #include - #include -+#include - #include - #include - #include - #include - #include - #include -+#include - - namespace - { -@@ -80,11 +82,42 @@ namespace - << QObject::tr("%1 version %2\n").arg(app_master).arg(app_version); - } - -+ //Note: array must be sorted to allow usage of binary search -+ static constexpr char const * const ALLOWED_VARS[] = { -+ "DISPLAY" -+ , "LANG", "LANGUAGE", "LC_ADDRESS", "LC_ALL", "LC_COLLATE", "LC_CTYPE", "LC_IDENTIFICATION", "LC_MEASUREMENT" -+ , "LC_MESSAGES", "LC_MONETARY", "LC_NAME", "LC_NUMERIC", "LC_PAPER", "LC_TELEPHONE", "LC_TIME" -+ , "PATH", "QT_PLATFORM_PLUGIN", "QT_QPA_PLATFORMTHEME", "WAYLAND_DISPLAY", "XAUTHORITY" -+ }; -+ static constexpr char const * const * const ALLOWED_END = ALLOWED_VARS + sizeof (ALLOWED_VARS) / sizeof (ALLOWED_VARS[0]); -+ struct assert_helper -+ { -+ assert_helper() -+ { -+ Q_ASSERT(std::is_sorted(ALLOWED_VARS, ALLOWED_END -+ , [] (char const * const a, char const * const b) { return strcmp(a, b) < 0; })); -+ } -+ }; -+ assert_helper h; -+ - inline void env_workarounds() - { -- //cleanup environment -- //pcmanfm-qt will not start if the DBUS_SESSION_BUS_ADDRESS is preserved -- unsetenv("DBUS_SESSION_BUS_ADDRESS"); -+ std::cerr << LXQTSUDO << ": Stripping child environment except for: "; -+ std::copy(ALLOWED_VARS, ALLOWED_END - 1, std::ostream_iterator{std::cerr, ", "}); -+ std::cerr << *(ALLOWED_END - 1) << '\n'; // printing the last separately to avoid trailing comma -+ // cleanup environment, because e.g.: -+ // - pcmanfm-qt will not start if the DBUS_SESSION_BUS_ADDRESS is preserved -+ // - Qt apps may change user's config files permissions if the XDG_* are preserved -+ for (auto const & key : QProcessEnvironment::systemEnvironment().keys()) -+ { -+ auto const & i = std::lower_bound(ALLOWED_VARS, ALLOWED_END, key, [] (char const * const a, QString const & b) { -+ return b > a; -+ }); -+ if (i == ALLOWED_END || key != *i) -+ { -+ unsetenv(key.toStdString().c_str()); -+ } -+ } - } - } -