aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2023-08-08 22:06:42 +0200
committer Eric Hameleers <alien@slackware.com>2023-08-08 22:06:42 +0200
commit0afdeacd89149192bcc4c76a2cda6fb8d22e6516 (patch)
treefbe7dc68ebdb88fe71529452adf627281de18418
parent5b191966a5ba3044b55b845bbec1512cd91a554e (diff)
downloadliveslak-0afdeacd89149192bcc4c76a2cda6fb8d22e6516.tar.gz
liveslak-0afdeacd89149192bcc4c76a2cda6fb8d22e6516.tar.xz
Make kdesu work again with sudo backend (using live password)
For kdesu to work with the sudo backend in KDE5 with newer versions of sudo (since 2022), we need to disable use_pty for kdesu. KDE5 fixed this in git on 04-aug-2023, see https://bugs.kde.org/show_bug.cgi?id=452532 but it does not hurt to implement the workaround in liveslak, as it helps to support older KDE releases. This is the KDE commit message, see https://invent.kde.org/frameworks/kdesu/-/commit/732dd812d67c7fa62bd187c1171950ca85259b0b : Recent versions of sudo have use_pty enabled by default, which means that sudo creates a PTY for starting the user process inside after successful authentication. This PTY inherits the configuration of sudo's TTY, but later changes are not transferred. Make sure that echo is already disabled when sudo is started, as disabling it later has no effect on the nested PTY.
-rwxr-xr-xmake_slackware_live.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index 57d1545..c55fc05 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -2626,6 +2626,18 @@ EOT
super-user-command=sudo
KDESU_EOF
+ # For the above to work in KDE5 with newer versions of sudo (since 2022),
+ # we need the following also. KDE5 fixed this in git on 04-aug-2023, see
+ # https://bugs.kde.org/show_bug.cgi?id=452532 but it does not hurt to have
+ # it here, and it helps to support older KDE releases:
+ if [ -x ${LIVE_ROOTDIR}/usr/lib*/libexec/kf5/kdesu_stub ]; then
+ mkdir -p ${LIVE_ROOTDIR}/etc/sudoers.d
+ chmod 750 ${LIVE_ROOTDIR}/etc/sudoers.d
+ cat <<KDESU_EOF2 >${LIVE_ROOTDIR}/etc/sudoers.d/kdesu
+Defaults!/usr/lib*/libexec/kf5/kdesu_stub !use_pty
+KDESU_EOF2
+ fi
+
# Set akonadi backend:
cat <<AKONADI_EOF >${LIVE_ROOTDIR}/etc/skel/.config/akonadi/akonadiserverrc
[%General]