diff --git a/security/lxqt-sudo/Makefile b/security/lxqt-sudo/Makefile index 8a2dd2d5bb99..751cf33cff28 100644 --- a/security/lxqt-sudo/Makefile +++ b/security/lxqt-sudo/Makefile @@ -1,23 +1,23 @@ PORTNAME= lxqt-sudo PORTVERSION= 2.3.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= LXQT MAINTAINER= lxqt@FreeBSD.org COMMENT= GUI frontend to su/sudo/doas for LXQt desktop WWW= https://lxqt-project.org LICENSE= LGPL21+ USES= cmake compiler:c++20-lang gettext kde:6 lxqt:2 qt:6 perl5 tar:xz \ gnome sudo xorg USE_PERL5= build USE_QT= base:run tools:build svg USE_KDE= windowsystem USE_GNOME= glib20 USE_LXQT= buildtools2 lxqt USE_XORG= x11 .include diff --git a/security/lxqt-sudo/files/patch-sudo.cpp b/security/lxqt-sudo/files/patch-sudo.cpp index 4f710f0251e1..93057cc863a6 100644 --- a/security/lxqt-sudo/files/patch-sudo.cpp +++ b/security/lxqt-sudo/files/patch-sudo.cpp @@ -1,63 +1,52 @@ ---- sudo.cpp.orig 2023-04-15 15:54:02 UTC +--- sudo.cpp.orig 2025-11-05 12:14:34 UTC +++ sudo.cpp @@ -44,7 +44,7 @@ #else #include #include -#include +#include #endif #include #include @@ -65,6 +65,9 @@ namespace const QString su_prog{QStringLiteral(LXQTSUDO_SU)}; const QString sudo_prog{QStringLiteral(LXQTSUDO_SUDO)}; +#ifdef __FreeBSD__ + const QString pwd_prompt_end_c_locale{QStringLiteral(":")}; +#endif const QString doas_prog{QStringLiteral(LXQTSUDO_DOAS)}; const QString pwd_prompt_end{QStringLiteral(": ")}; const QChar nl{QLatin1Char('\n')}; -@@ -194,7 +197,9 @@ int Sudo::main() - } else if (QStringLiteral("-a") == arg1 || QStringLiteral("--doas") == arg1) - { - mBackend = BACK_DOAS; -- mArgs.removeAt(0); -+ mArgs.removeAt(0); //remove -m -+ mArgs.removeAt(1); //remove root -+ mArgs.removeAt(2); // remove -c - } - } - //any other arguments we simply forward to su/sudo -@@ -265,7 +270,7 @@ void Sudo::child() +@@ -272,7 +275,7 @@ void Sudo::child() switch (mBackend) { case BACK_SU: - params_cnt += 1; // -c for su + params_cnt += 3; // -m root -c for su break; case BACK_SUDO: params_cnt += 3; // --preserve-env=... /bin/sh -c for sudo -@@ -295,8 +300,10 @@ void Sudo::child() +@@ -302,8 +305,10 @@ void Sudo::child() break; case BACK_DOAS: *(param_arg++) = "/bin/sh"; - [[fallthrough]]; + break; case BACK_SU: + *(param_arg++) = "-m"; + *(param_arg++) = "root"; case BACK_NONE: - env_workarounds(); + env_workarounds(mQuiet); break; -@@ -404,7 +411,8 @@ int Sudo::parent() +@@ -414,7 +419,8 @@ int Sudo::parent() } } else { - if (line.endsWith(pwd_prompt_end)) + if(line.endsWith(pwd_prompt_end_c_locale) || line.endsWith(pwd_prompt_end)) + { //if now echo is turned off, su/sudo requests password struct termios tios;