Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

257.65. kdesu-6.31.0

KDE Frameworks: running programs as another user through sudo

6.31.0-1 · GPL-2.0-only AND LGPL-2.0-or-later · 0.8 SBU · 330.5 KiB, 29 files · 43_toolkits, 196 of 344 · ports/core/kf6/kdesu

Homepage: https://invent.kde.org/frameworks/kdesu

Why it is in KDOS. The comment above the 61 ports from karchive to kfilemetadata in script/phases/43_toolkits/packages.d/kf6.txt:

The libraries KDE applications are built on, without Plasma.

KDESu runs a program as another user, root by default, from a KDE program: it drives sudo (or su, or doas) on a pseudo-terminal from kpty, answers its password prompt with the password the user typed into a dialog, and starts the program through kdesu_stub, which passes on the environment the program needs. The kdesu command of kde-cli-tools is its front end.

Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, kconfig, kcoreaddons, ki18n, kpty, libX11, sudo.

Required by (2): kde-cli-tools, konqueror.

Sources: kdesu-6.31.0.tar.xz (56.1 KiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install kdesu'

build.sh:

cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D BUILD_TESTING=OFF \
	-D KF_SKIP_PO_PROCESSING=ON \
	-D KDESU_USE_SUDO_DEFAULT=ON \
	-D KDESU_USE_DOAS_DEFAULT=OFF \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

Libraries: libKF6Su.so.

Directories: /usr/include/KF6/KDESu, /usr/lib/cmake/KF6Su, /usr/share/licenses/kdesu.

The configure looks for libX11 as optional and, finding it, lets kdesu_stub pass the X authority on to the program it starts, for a program that runs under Xwayland; libX11 is in depends so that this is always built.

The password exchange needs sudo to print nothing before its prompt: KDESu takes the first line that ends in a colon with nothing after it for the prompt. sudo is built --without-lecture for this; a lecture in front of the prompt fails every attempt as a wrong password.