Compare commits

..

No commits in common. "ubuntu/resolute" and "ubuntu/1.4.0-0ubuntu2" have entirely different histories.

8 changed files with 199 additions and 131 deletions

52
debian/changelog vendored
View File

@ -1,55 +1,3 @@
lxqt-sudo (2.2.0-0ubuntu2) resolute; urgency=medium
* Drop superfluous recommends on lxqt-qtplugin. Makes lxqt-sudo usable
on flavours other than Lubuntu without pulling in significant other
parts of lxqt onto images.
-- Rik Mills <rikmills@kde.org> Mon, 03 Nov 2025 15:40:14 +0000
lxqt-sudo (2.2.0-0ubuntu1) questing; urgency=medium
* New upstream release.
- Update build dependencies.
* Update copyright file.
* Update Standards-Version to 4.7.2, no changes needed.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Thu, 31 Jul 2025 16:30:59 -0500
lxqt-sudo (2.1.0-0ubuntu3) plucky; urgency=medium
* Update Standards-Version to 4.7.1, no changes needed.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 21 Feb 2025 16:53:25 -0600
lxqt-sudo (2.1.0-0ubuntu2) plucky; urgency=medium
* No-change rebuild for lxqt-build-tools C++17 -> C++20.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 03 Jan 2025 03:59:31 -0600
lxqt-sudo (2.1.0-0ubuntu1) plucky; urgency=medium
* New upstream version.
- Bump build dependencies.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 15 Nov 2024 15:33:17 -0600
lxqt-sudo (2.0.0-0ubuntu2) plucky; urgency=medium
* Update the patch to pass through env vars.
-- Simon Quigley <tsimonq2@ubuntu.com> Wed, 16 Oct 2024 17:09:37 -0500
lxqt-sudo (2.0.0-0ubuntu1) oracular; urgency=medium
* New upstream release.
* Update copyright file.
* Drop enable-bidirectional-communication.patch, applied upstream.
* Bump Standards-Version to 4.7.0, no changes necessary.
* Adjust dependencies.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Thu, 15 Aug 2024 16:43:15 -0500
lxqt-sudo (1.4.0-0ubuntu2) noble; urgency=medium lxqt-sudo (1.4.0-0ubuntu2) noble; urgency=medium
* Patch in bidirectional communication support (see * Patch in bidirectional communication support (see

21
debian/control vendored
View File

@ -1,6 +1,6 @@
Source: lxqt-sudo Source: lxqt-sudo
Maintainer: Lubuntu Developers <lubuntu-devel@lists.ubuntu.com> Maintainer: Lubuntu Developers <lubuntu-devel@lists.ubuntu.com>
Original-Maintainer: LXQt Packaging Team <pkg-lxqt-devel@lists.alioth.debian.org> XSBC-Original-Maintainer: LXQt Packaging Team <pkg-lxqt-devel@lists.alioth.debian.org>
Uploaders: Alf Gaida <agaida@siduction.org>, Uploaders: Alf Gaida <agaida@siduction.org>,
ChangZhuo Chen (陳昌倬) <czchen@debian.org>, ChangZhuo Chen (陳昌倬) <czchen@debian.org>,
Andrew Lee (李健秋) <ajqlee@debian.org>, Andrew Lee (李健秋) <ajqlee@debian.org>,
@ -9,22 +9,23 @@ Uploaders: Alf Gaida <agaida@siduction.org>,
Section: x11 Section: x11
Priority: optional Priority: optional
Build-Depends: debhelper-compat (= 13), Build-Depends: debhelper-compat (= 13),
libkf6windowsystem-dev, libkf5windowsystem-dev,
liblxqt2-dev (>= 2.2.0), liblxqt1-dev (>= 1.4.0),
libx11-dev, libqt5svg5-dev,
qt6-svg-dev (>= 6.6.0) libqt5x11extras5-dev,
Standards-Version: 4.7.2 libx11-dev
Standards-Version: 4.6.2
Vcs-Browser: https://git.lubuntu.me/Lubuntu/lxqt-sudo-packaging Vcs-Browser: https://git.lubuntu.me/Lubuntu/lxqt-sudo-packaging
Vcs-Git: https://git.lubuntu.me/Lubuntu/lxqt-sudo-packaging.git Vcs-Git: https://git.lubuntu.me/Lubuntu/lxqt-sudo-packaging.git
Debian-Vcs-Browser: https://salsa.debian.org/cgit/pkg-team/lxqt-sudo XS-Debian-Vcs-Browser: https://salsa.debian.org/cgit/pkg-team/lxqt-sudo
Debian-Vcs-Git: https://salsa.debian.org/lxqt-team/lxqt-sudo.git XS-Debian-Vcs-Git: https://salsa.debian.org/lxqt-team/lxqt-sudo.git
Homepage: https://github.com/lxqt/lxqt-sudo Homepage: https://github.com/lxqt/lxqt-sudo
Rules-Requires-Root: no Rules-Requires-Root: no
Package: lxqt-sudo Package: lxqt-sudo
Architecture: any Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends} Depends: ${misc:Depends}, ${shlibs:Depends}
Recommends: lxqt-sudo-l10n Recommends: lxqt-qtplugin, lxqt-sudo-l10n
Description: Graphical Qt frontend for plain sudo Description: Graphical Qt frontend for plain sudo
lxqt-sudo is a graphical Qt frontend for plain sudo(8) (for requesting lxqt-sudo is a graphical Qt frontend for plain sudo(8) (for requesting
optional password in GUI fashion). When invoked it simply spawns child sudo optional password in GUI fashion). When invoked it simply spawns child sudo
@ -36,7 +37,7 @@ Package: lxqt-sudo-l10n
Architecture: all Architecture: all
Multi-Arch: foreign Multi-Arch: foreign
Section: localization Section: localization
Depends: qt6-translations-l10n, ${misc:Depends} Depends: qttranslations5-l10n, ${misc:Depends}
Description: Language package for lxqt-sudo Description: Language package for lxqt-sudo
The l10n files for lxqt-sudo. The l10n files for lxqt-sudo.
. .

7
debian/copyright vendored
View File

@ -3,16 +3,15 @@ Upstream-Name: lxqt-sudo
Source: https://github.com/lxqt/lxqt-sudo Source: https://github.com/lxqt/lxqt-sudo
Files: * Files: *
Copyright: 2015-2025 LXQt team Copyright: 2015-2023 LXQt team
2015-2018 Palo Kisa <palo.kisa@gmail.com> 2015-2018 Palo Kisa <palo.kisa@gmail.com>
License: LGPL-2.1+ License: LGPL-2.1+
Files: debian/* Files: debian/*
Copyright: 2021-2025 Lubuntu Developers <lubuntu-devel@lists.ubuntu.com> Copyright: 2021-2024 Lubuntu Developers <lubuntu-devel@lists.ubuntu.com>
2015-2019 Alf Gaida <agaida@siduction.org> 2015-2019 Alf Gaida <agaida@siduction.org>
2015 Andrew Lee (李健秋) <ajqlee@debian.org> 2015 Andrew Lee (李健秋) <ajqlee@debian.org>
2025 Aaron Rainbolt <arraybolt3@ubuntu.com> 2015 ChangZhuo Chen (陳昌倬) <czchen@debian.org>
2015-2025 ChangZhuo Chen (陳昌倬) <czchen@debian.org>
License: LGPL-2.1+ License: LGPL-2.1+
License: LGPL-2.1+ License: LGPL-2.1+

View File

@ -8,7 +8,7 @@ Last-Update: 2023-10-11
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/sudo.cpp --- a/sudo.cpp
+++ b/sudo.cpp +++ b/sudo.cpp
@@ -84,6 +84,7 @@ namespace @@ -83,6 +83,7 @@ namespace
" -s|--su Use %3(1) as backend.\n" " -s|--su Use %3(1) as backend.\n"
" -d|--sudo Use %2(8) as backend.\n" " -d|--sudo Use %2(8) as backend.\n"
" -a|--doas Use %4(1) as backend.\n" " -a|--doas Use %4(1) as backend.\n"
@ -16,7 +16,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
" command Command to run.\n" " command Command to run.\n"
" arguments Optional arguments for command.\n\n").arg(app_master).arg(sudo_prog).arg(su_prog).arg(doas_prog); " arguments Optional arguments for command.\n\n").arg(app_master).arg(sudo_prog).arg(su_prog).arg(doas_prog);
if (!err.isEmpty()) if (!err.isEmpty())
@@ -114,8 +115,13 @@ namespace @@ -113,8 +114,13 @@ namespace
}; };
assert_helper h; assert_helper h;
@ -31,7 +31,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
std::cerr << LXQTSUDO << ": Stripping child environment except for: "; std::cerr << LXQTSUDO << ": Stripping child environment except for: ";
std::ostringstream left_env_params; std::ostringstream left_env_params;
std::copy(ALLOWED_VARS, ALLOWED_END - 1, std::ostream_iterator<const char *>{left_env_params, ","}); std::copy(ALLOWED_VARS, ALLOWED_END - 1, std::ostream_iterator<const char *>{left_env_params, ","});
@@ -196,6 +202,10 @@ int Sudo::main() @@ -195,6 +201,10 @@ int Sudo::main()
{ {
mBackend = BACK_DOAS; mBackend = BACK_DOAS;
mArgs.removeAt(0); mArgs.removeAt(0);
@ -42,7 +42,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
} }
} }
//any other arguments we simply forward to su/sudo //any other arguments we simply forward to su/sudo
@@ -287,11 +297,13 @@ void Sudo::child() @@ -286,11 +296,11 @@ void Sudo::child()
switch (mBackend) switch (mBackend)
{ {
case BACK_SUDO: case BACK_SUDO:
@ -54,14 +54,12 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+ if(!mPreserveEnv) { + if(!mPreserveEnv) {
+ preserve_env_param = "--preserve-env="; + preserve_env_param = "--preserve-env=";
+ preserve_env_param += env_workarounds(mPreserveEnv); + preserve_env_param += env_workarounds(mPreserveEnv);
+ } else { + *(param_arg++) = preserve_env_param.c_str(); //preserve environment
+ preserve_env_param = "--preserve-env";
+ } + }
+ *(param_arg++) = preserve_env_param.c_str();
*(param_arg++) = "/bin/sh"; *(param_arg++) = "/bin/sh";
break; break;
case BACK_DOAS: case BACK_DOAS:
@@ -299,7 +311,7 @@ void Sudo::child() @@ -298,7 +308,7 @@ void Sudo::child()
[[fallthrough]]; [[fallthrough]];
case BACK_SU: case BACK_SU:
case BACK_NONE: case BACK_NONE:

View File

@ -0,0 +1,122 @@
Description: Enable bidirectional communication
lxqt-sudo shows you what an executed process prints to stdout/stderr, but it
doesn't send anything written to lxqt-sudo's stdin to the child process. This
patch fixes that and adds some small miscellaneous improvements.
Origin: https://github.com/ArrayBolt3/lxqt-sudo/compare/d69855c2900d10c2aae4d39678b71aadf37dc37c...4f430cb0fe240566e74ade15e1657b1f99177c12
Forwarded: https://github.com/lxqt/lxqt-sudo/pull/210
Last-Update: 2024-01-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
diff --git a/sudo.cpp b/sudo.cpp
index d12f77c..eebcf5c 100644
--- a/sudo.cpp
+++ b/sudo.cpp
@@ -68,6 +68,7 @@ namespace
const QString doas_prog{QStringLiteral(LXQTSUDO_DOAS)};
const QString pwd_prompt_end{QStringLiteral(": ")};
const QChar nl{QLatin1Char('\n')};
+ constexpr int term_eol_size = 2;
void usage(QString const & err = QString())
{
@@ -374,12 +375,14 @@ int Sudo::parent()
}
QTextStream child_str{pwd_f};
+ // pseudoterminal echoes everything written into it's input; we don't want duplicating input
+ int inhibit_count = 0;
QObject::connect(mDlg.data(), &QDialog::finished, [&] (int result)
{
if (QDialog::Accepted == result)
{
- child_str << mDlg->password().append(nl);
+ child_str << mDlg->password() << nl;
child_str.flush();
} else
{
@@ -388,6 +391,8 @@ int Sudo::parent()
});
QString last_line;
+ QString const & error_check = QStringLiteral("%1:").arg(backendName());
+ QTextStream stderr_str{stderr, QIODevice::WriteOnly};
QScopedPointer<QSocketNotifier> pwd_watcher{new QSocketNotifier{mPwdFd, QSocketNotifier::Read}};
auto reader = [&]
{
@@ -396,11 +401,10 @@ int Sudo::parent()
{
pwd_watcher.reset(nullptr); //stop the notifications events
- QString const & prog = backendName();
- if (last_line.startsWith(QStringLiteral("%1:").arg(prog)))
+ if (last_line.startsWith(error_check))
{
QMessageBox(QMessageBox::Critical, mDlg->windowTitle()
- , tr("Child '%1' process failed!\n%2").arg(prog).arg(last_line), QMessageBox::Ok).exec();
+ , tr("Child '%1' process failed!\n%2").arg(backendName()).arg(last_line), QMessageBox::Ok).exec();
}
} else
{
@@ -414,18 +418,56 @@ int Sudo::parent()
if (!(ECHO & tios.c_lflag))
{
mDlg->show();
- return;
}
}
- QTextStream{stderr, QIODevice::WriteOnly} << line;
- //assuming text oriented output
- QStringList lines = line.split(nl, Qt::SkipEmptyParts);
- last_line = lines.isEmpty() ? QString() : lines.back();
+ if (inhibit_count > 0)
+ {
+ if (inhibit_count < line.count())
+ {
+ stderr_str << line.right(line.count() - inhibit_count);
+ stderr_str.flush();
+ inhibit_count = 0;
+ } else
+ {
+ inhibit_count -= line.count();
+ }
+ } else
+ {
+ stderr_str << line;
+ stderr_str.flush();
+ }
+
+ //assuming text oriented output; find the last non-empty line
+ auto i = line.crbegin(), i_end = line.crbegin(), i_crend = line.crend();
+ do {
+ i_end = i + 1;
+ i = std::find(i_end, i_crend, nl);
+ } while (i != i_crend && std::distance(i, i_end) == 0);
+
+ last_line.clear();
+ last_line.reserve(std::distance(i, i_end));
+ std::for_each(i.base(), i_end.base(), [&last_line](decltype (*i.base()) val) { last_line.append(val); });
}
};
+ QTextStream stdin_str{stdin, QIODevice::ReadOnly};
+ QScopedPointer<QSocketNotifier> stdin_watcher{new QSocketNotifier{STDIN_FILENO, QSocketNotifier::Read}};
+ auto writer = [&]
+ {
+ QString line = stdin_str.readLine();
+ if (line.isEmpty()) {
+ stdin_watcher.reset(nullptr); //stop the notification events
+ } else
+ {
+ inhibit_count += line.count() + term_eol_size;
+ child_str << line << nl;
+ child_str.flush();
+ }
+ };
+
QObject::connect(pwd_watcher.data(), &QSocketNotifier::activated, reader);
+ QObject::connect(stdin_watcher.data(), &QSocketNotifier::activated, writer);
std::unique_ptr<std::thread> child_waiter;
QTimer::singleShot(0, [&child_waiter, this] {

View File

@ -1 +1,2 @@
bypass-envvar-allowlist.patch bypass-envvar-allowlist.patch
enable-bidirectional-communication.patch

11
debian/watch vendored
View File

@ -1,6 +1,5 @@
Version: 5 version=4
Template: GitHub opts="searchmode=plain, \
Owner: lxqt pgpsigurlmangle=s/$/.asc/, \
Project: @PACKAGE@ uversionmangle=s/(\d+\.\d+\.\d+).*/$1/" \
Download-Url-Mangle: s%https://api.github.com/repos/([^/]+)/@PACKAGE@/git/refs/tags/@ANY_VERSION@%https://github.com/$1/@PACKAGE@/releases/download/$2/@PACKAGE@-$2.tar.xz%g https://api.github.com/repos/lxqt/@PACKAGE@/releases https:\/\/github.com\/lxqt\/@PACKAGE@\/releases\/download\/@ANY_VERSION@\/@PACKAGE@-@ANY_VERSION@.tar.xz
Pgp-Mode: auto