From 0afdeacd89149192bcc4c76a2cda6fb8d22e6516 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 8 Aug 2023 22:06:42 +0200 Subject: 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. --- make_slackware_live.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'make_slackware_live.sh') 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 <${LIVE_ROOTDIR}/etc/sudoers.d/kdesu +Defaults!/usr/lib*/libexec/kf5/kdesu_stub !use_pty +KDESU_EOF2 + fi + # Set akonadi backend: cat <${LIVE_ROOTDIR}/etc/skel/.config/akonadi/akonadiserverrc [%General] -- cgit v1.2.3