From ae9dc3d805becfee265a35b53af50f10c7f98c6f Mon Sep 17 00:00:00 2001 From: Andrew Savinykh <658865+AndrewSav@users.noreply.github.com> Date: Sun, 29 Nov 2026 01:16:12 +0000 Subject: [PATCH] Clear the expiry Debian 13 sets on the clamav account clamav-base 1.4.6+dfsg-1~deb13u1 creates its user from sysusers.d as a locked system account ("u!"), which also sets it to expire on 1970-01-02. Images built since then have an expired clamav account, and su to it fails with "Your account has expired". cron checks the account through the same PAM account stack, so the hourly clamav-unofficial-sigs update is refused as well. The startup update is not affected, since it drops to clamav with s6-setuidgid. Clear the expiry after the packages are installed. The password stays locked. A new test checks that the account does not expire. --- Dockerfile | 6 ++++++ test/default.bats | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index c2efd19..eccec9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,12 @@ RUN apt-get update && apt-get install -y -q --no-install-recommends \ inotify-tools \ # To enable compression in imap arj bzip2 cabextract cpio file gzip nomarch pax unzip zip \ + # clamav-base 1.4.6 creates its user as a locked system account + # (sysusers.d "u!"), which also sets it to expire on 1970-01-02. cron, like + # su, checks the account through PAM and refuses an expired one, so the + # hourly clamav-unofficial-sigs update is refused. Clear the expiry; the + # password stays locked. + && usermod -e '' clamav \ && rm -rf /var/spool/postfix \ && ln -s /var/mail/postfix/spool /var/spool/postfix \ && apt-get autoremove -y \ diff --git a/test/default.bats b/test/default.bats index 5cf2ace..b206f88 100644 --- a/test/default.bats +++ b/test/default.bats @@ -784,6 +784,14 @@ load 'test_helper/bats-assert/load' assert_success } +# cron checks the account through PAM and refuses an expired one. clamav-base +# 1.4.6 creates clamav already expired (see the Dockerfile). +@test "checking clamav-unofficial-sigs: the clamav account does not expire" { + run docker exec mailserver_default chage -l clamav + assert_success + assert_output --regexp 'Account expires[[:space:]]*: never' +} + # The update runs as clamav, at startup and from cron, and reads the copy of # user.conf that setup makes. The suite's user.conf is readable by its owner # only, as an administrator's may be.