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

79.4. krb5-1.22.2

Kerberos 5 authentication libraries and tools

Version 1.22.2, release 2
Shelf auth — Authentication, authorisation, accounts and directory services
Phase 41_system (System), 169 of 1047 in build order
Licence MIT
Homepage https://web.mit.edu/kerberos/
Build time 2.3 SBU
Installed size 3.8 MiB in 123 files
Recipe ports/core/auth/krb5/kpkgbuild

About

MIT Kerberos 5 provides the libraries (libkrb5, libgssapi_krb5 and the rest) and the client tools — kinit, klist, kdestroy, kpasswd, kvno — with which a machine gets and uses tickets from a realm’s key distribution centre. KDOS needs it as a client and nothing more: kinit gets a ticket, and cifs.upcall from cifs-utils hands it to the kernel’s cifs module so that a sec=krb5 mount reaches a file server that will not take a password. The server half — the KDC, kadmind, the database utilities — is built, because there is no switch to leave it out, and then removed from the package. See also Kerberos is built and has never been given a ticket.

Why it is in KDOS

The comment above it in script/phases/41_system/packages.d/auth.txt:

A TICKET, BECAUSE A CORPORATE FILE SERVER OFTEN WILL NOT TAKE A PASSWORD. kinit gets one and cifs.upcall — which is what puts krb5 in cifs-utils' depends — hands it to the kernel's cifs module, so sec=krb5 has somewhere to call out to. The client half only: no KDC and no administration daemon are installed.

Sources

Dependencies

Depends on: openssl, keyutils, e2fsprogs, bison.

Required by (14): chromium, cifs-utils, freerdp, libsoup3, libssh, libtirpc, nfs-utils, openconnect, openssh, postgresql, qt6-qtbase, qt6-qtwebengine, wine, wireshark.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

Patches

build.sh applies these; kpkg applies nothing by itself.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install krb5'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/auth/krb5.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/auth/krb5
echo '3243ffbc8ea4d4ac22ddc7dd2a1dc54c57874c40648b60ff97009763554eaf13  krb5-1.22.2.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/krb5
SRC=$SRC_ROOT/krb5-1.22.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf krb5-1.22.2.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/openssl4.patch"

cd src

./configure \
	--prefix=/usr \
	--sysconfdir=/etc \
	--localstatedir=/var \
	--libdir=/usr/lib \
	--runstatedir=/run \
	--sbindir=/usr/sbin \
	--disable-static \
	--disable-rpath \
	--disable-nls \
	--enable-dns-for-realm \
	--with-crypto-impl=openssl \
	--with-tls-impl=openssl \
	--with-spake-openssl \
	--enable-pkinit \
	--with-keyutils \
	--with-system-et \
	--without-system-verto \
	--without-ldap \
	--without-readline \
	--without-libedit \
	--without-lmdb
make
make DESTDIR=$PKG install
rm -rf "$PKG/run"

for _s in krb5kdc kadmind kadmin.local kdb5_util kprop kpropd \
	  kproplog sserver gss-server sim_server uuserver krb5-send-pr; do
	rm -f "$PKG/usr/sbin/$_s"
done

for _s in gss-client sclient sim_client uuclient krb5-send-pr; do
	rm -f "$PKG/usr/bin/$_s"
done

rm -f "$PKG/usr/bin/ksu"
rm -f "$PKG/usr/share/man/man1/ksu.1"*

for _s in krb5kdc kadmind kadmin.local kdb5_util kdb5_ldap_util kprop kpropd \
	  kproplog sserver sclient kdc.conf kadm5.acl; do
	rm -f "$PKG/usr/share/man/man1/$_s."* \
	      "$PKG/usr/share/man/man5/$_s."* "$PKG/usr/share/man/man8/$_s."*
done

install -Dm644 /dev/stdin "$PKG/etc/request-key.d/cifs.spnego.conf" <<'RK'
create cifs.spnego * * /usr/sbin/cifs.upcall %k
RK

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/krb5, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf krb5-1.22.2-2.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/krb5, and runs the triggers its paths call for.

Contents

Installed programs: k5srvutil, kadmin, kdestroy, kinit, klist, kpasswd, krb5-config, kswitch, ktutil, kvno.

Installed libraries: libgssapi_krb5.so, libgssrpc.so, libk5crypto.so, libkadm5clnt.so, libkadm5clnt_mit.so, libkadm5srv.so, libkadm5srv_mit.so, libkdb5.so, libkrad.so, libkrb5.so, libkrb5support.so, libverto.so.

Installed directories: /usr/include/gssapi, /usr/include/gssrpc, /usr/include/kadm5, /usr/include/krb5, /usr/lib/krb5, /usr/share/examples, /usr/share/licenses/krb5, /var/krb5kdc.

Short descriptions

k5srvutil host key table (keytab) manipulation utility
kadmin Kerberos V5 database administration program
kdestroy destroy Kerberos tickets
kinit obtain and cache Kerberos ticket-granting ticket
klist list cached Kerberos tickets
kpasswd change a user's Kerberos password
krb5-config tool for linking against MIT Kerberos libraries
kswitch switch primary ticket cache
ktutil Kerberos keytab file maintenance utility
kvno print key version numbers of Kerberos principals
gssrpc.pc GSSAPI RPC implementation
kadm-client.pc Kerberos administration client library
kadm-server.pc Kerberos administration server library
kdb.pc Kerberos database access libraries
krb5.pc An implementation of Kerberos network authentication
krb5-gssapi.pc Kerberos implementation of the GSSAPI
mit-krb5.pc An implementation of Kerberos network authentication
mit-krb5-gssapi.pc Kerberos implementation of the GSSAPI

Notes