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

344.2. kwallet-pam-6.8.2

PAM module that unlocks the KDE wallet with the login password

6.8.2-1 · LGPL-2.1-or-later · 0.1 SBU · 73.1 KiB, 6 files · 50_desktop, 8 of 92 · ports/core/auth/kwallet-pam

Homepage: https://invent.kde.org/plasma/kwallet-pam

Why it is in KDOS. The comment above it in script/phases/50_desktop/packages.txt:

Opens the wallet with the password typed at login, so the Secret Service ksecretd provides is unlocked without a second prompt.

kwallet-pam opens the user’s KDE wallet with the password typed at login, so the Secret Service that kwallet’s ksecretd provides is unlocked without a second prompt. It is two pieces: pam_kwallet5.so, a PAM module for the login manager’s stacks, and pam_kwallet_init, which an XDG autostart entry runs once the session’s environment exists.

Depends on: cmake, ninja, extra-cmake-modules, pkgconf, pam, libgcrypt, kwallet, socat.

Required by (1): kde-plasma.

Sources: kwallet-pam-6.8.2.tar.xz (21.9 KiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/50_desktop/phase.env && kpkg install kwallet-pam'

build.sh:

test -x /usr/bin/ksecretd

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 \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
rm -rf "$PKG/usr/lib/systemd"

Directories: /usr/share/licenses/kwallet-pam.

In the auth phase the module only keeps the typed password for the session phase; it does nothing for root or for an empty password. In the session phase it salts and hashes the password, forks, starts the wallet daemon as the user with the hash on a pipe, and exports the socket the daemon listens on as PAM_KWALLET5_LOGIN. pam_kwallet_init later hands the session’s environment to the waiting daemon over that socket with socat, which is in depends for run time; the configure only warns when it is missing.

The daemon the module starts is compiled in from KWALLETD_BIN_PATH, which the configure reads from KF6Wallet’s CMake package: /usr/bin/ksecretd. The first line of build.sh stops the build unless that program exists, because a module built against a kwallet without ksecretd would exec a missing file at every login and unlock nothing.

The module does nothing until a PAM stack names it, and the login manager’s stacks carry -auth optional pam_kwallet5.so and -session optional pam_kwallet5.so. It reads only the arguments kdehome=, kwalletd=, socketPath= and force_run, and its session phase runs only for a graphical session, which it recognises from an X display or from XDG_SESSION_TYPE set to wayland or x11, unless force_run is given. With no password at login (autologin) there is nothing to unlock with, and an unlock of the screen locker runs no session phase, so the wallet stays locked and asks on first use (see The security model).

The install puts a systemd user unit, plasma-kwallet-pam.service, under /usr/lib/systemd; build.sh removes the directory, since KDOS has no systemd (see No systemd). The XDG autostart entry, /etc/xdg/autostart/pam_kwallet_init.desktop, does the same job.