41.2. cyrus-sasl-2.1.28
SASL authentication library — the mechanism loader mbsync authenticates through
| Version | 2.1.28, release 1 |
| Shelf | auth — Authentication, authorisation, accounts and directory services |
| Phase | 30_foundation (Build Foundation), 81 of 127 in build order |
| Licence | BSD-Attribution-HPND-disclaimer |
| Homepage | https://www.cyrusimap.org/sasl/ |
| Build time | 0.3 SBU |
| Installed size | 502.8 KiB in 69 files |
| Recipe | ports/core/auth/cyrus-sasl/kpkgbuild |
About
Cyrus SASL is the library a client program uses to authenticate to a server with SASL, the negotiation IMAP, SMTP, LDAP and VNC share. The library itself, libsasl2, knows no mechanism: it loads each one as a plugin from /usr/lib/sasl2, and the program asks it for whichever the server offers.
KDOS builds it as a mechanism loader for the client side. What it is here for is mail: mbsync from isync authenticates through it, and the XOAUTH2 mechanism a provider with no application passwords requires comes from the separate plugin cyrus-sasl-xoauth2, which installs into the same plugin directory. What that pair can and cannot sign in to is in mbsync has XOAUTH2 but not OAUTHBEARER. openldap, qemu’s VNC server, libvirt and spice link it as well. The build has no saslauthd client, no sasldb password store, no PAM check and no sample programs.
Why it is in KDOS
The comment above it in script/phases/30_foundation/packages.txt:
WHAT mbsync AUTHENTICATES THROUGH, with cyrus-sasl-xoauth2 in 41_system: the library ships no XOAUTH2 of its own. cyrus-sasl is the mechanism LOADER — client side only, with no saslauthd and no password store; the plugin is the mechanism a provider that has withdrawn application passwords requires. Without both, an account on such a provider can be read in aerc and sent through msmtp and cannot be mirrored into a local Maildir at all.
Sources
cyrus-sasl-2.1.28.tar.gz(3.8 MiB)
sha2567ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c
upstream: https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.28/cyrus-sasl-2.1.28.tar.gz
archive copy: sources-1/auth--cyrus-sasl-2.1.28.tar.gz
Dependencies
Depends on: openssl.
Required by (19): cyrus-sasl-xoauth2, gtk-vnc, isync, kdepim-runtime, kimap, kldap, ksmtp, libetpan, libkgapi, libksieve, libvirt, libvncserver, openldap, qca, qca-qt5, qemu, spice, spice-gtk, wlvncc.
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.
--without-pam, line 20: pam (explained with the switches below)--disable-gssapi, line 24: krb5 (explained with the switches below)
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/30_foundation/phase.env && kpkg install cyrus-sasl'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/auth/cyrus-sasl.
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/cyrus-sasl
echo '7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c cyrus-sasl-2.1.28.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/cyrus-sasl
SRC=$SRC_ROOT/cyrus-sasl-2.1.28
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf cyrus-sasl-2.1.28.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:
export CFLAGS="$CFLAGS -std=gnu17 -include time.h"
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-plugindir=/usr/lib/sasl2 \
--with-openssl \
--with-dblib=none \
--without-pam \
--without-saslauthd \
--without-authdaemond \
--disable-sample \
--disable-gssapi \
--disable-krb4 \
--disable-otp \
--disable-srp \
--disable-ntlm \
--disable-digest \
--disable-cram \
--disable-sql \
--disable-ldapdb \
--enable-plain \
--enable-login \
--enable-scram \
--enable-shared \
--disable-static
make -j1
make DESTDIR=$PKG install
install -Dm644 utils/pluginviewer.8 -t "$PKG/usr/share/man/man8"
The switches, and why each is set:
-std=gnu17— Compile as C17 with GNU extensions. The compiler’s default is C23, which does not accept old-style (K&R) function definitions such as those inlib/md5.c, one of the files the library is built from.-include time.h— Include<time.h>in every file.lib/saslutil.ccallstime(), but includes<time.h>only underHAVE_TIME_H, which configure never defines: it checks for<sys/time.h>only, and the generatedconfig.hthen includes<sys/time.h>in place of<time.h>. musl’s<sys/time.h>does not declaretime(), and the compiler refuses a call to an undeclared function.--with-plugindir=/usr/lib/sasl2— Wherelibsasl2looks for mechanism plugins, and where this build and cyrus-sasl-xoauth2 install them. It is upstream’s default for this prefix.--with-openssl— Link OpenSSL’slibcrypto. SCRAM is built only with it: configure disables SCRAM, with a warning, when OpenSSL is not found.--with-dblib=none— Build nosasldbuser database (Berkeley DB, GDBM or LMDB), and so nosaslpasswd2orsasldblistusers2. Only a server reads such a store.--without-pam— Do not check passwords through PAM. configure would otherwise look for it; pam is a41_systemport, not installed when this builds in30_foundation.--without-saslauthd,--without-authdaemond— Build no client of thesaslauthddaemon or of Courier’sauthdaemond; both are server-side password checks.--disable-sample— Build none of the sample client and server programs.--disable-gssapi,--disable-krb4— No Kerberos mechanisms: GSSAPI (and GS2, which needs it) and KERBEROS_V4. krb5 is a41_systemport.--disable-otp,--disable-srp,--disable-ntlm,--disable-digest,--disable-cram,--disable-sql,--disable-ldapdb— Build none of these plugins: the OTP, SRP, NTLM, DIGEST-MD5 and CRAM-MD5 mechanisms, and the SQL and LDAP auxiliary property stores. OTP, DIGEST-MD5 and CRAM-MD5 are on by upstream’s default; the others are off.--enable-plain,--enable-login— The PLAIN and LOGIN mechanisms, which send the user name and password as they are and are meant for use over TLS. LOGIN is off by upstream’s default.--enable-scram— The SCRAM-SHA-1 and SCRAM-SHA-256 mechanisms.
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/cyrus-sasl, 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 cyrus-sasl-2.1.28-1.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/cyrus-sasl, and runs the triggers its paths call for.
Contents
Installed programs: pluginviewer.
Installed libraries: libsasl2.so.
Installed directories: /usr/include/sasl, /usr/share/licenses/cyrus-sasl.
Short descriptions
pluginviewer |
list loadable SASL plugins and their properties |
libsasl2.pc |
Cyrus SASL implementation |
Notes
With --with-dblib=none, upstream’s utils/Makefile.am installs no manual pages at all, not even the one for pluginviewer, which is built regardless. build.sh installs pluginviewer.8 itself; pluginviewer -c lists the client mechanisms the library can load, which is the quickest way to see whether the XOAUTH2 plugin is in place.
The ANONYMOUS mechanism, libanonymous.so, is installed too: upstream builds it by default, and build.sh does not pass --disable-anon.