Repository navigation
Clear the expiry Debian 13 sets on the clamav account - #110
Merged
Merged
Conversation
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.
SaraSmiseth
approved these changes
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Note
TLDR: clamav 1.4.6 that the image gets from apt sets
clamavas expired. This breaks signature updates. This PR unsets it and adds a test for this.What is the current behavior (you can also link to an open issue here) ?
Debian 13 now ships
clamav-base1.4.6+dfsg-1~deb13u1 as a stable update. It creates its user from/usr/lib/sysusers.d/clamav-base.conf:The
u!makes it a locked account, and it also sets the shadow file's account-expiry field to 1, which means 1970-01-02:/etc/shadowlinechage -l clamav: Account expires1.2.2clamav:!:20773::::::clamav:!*:20786:::::1:The image runs the clamav-unofficial-sigs update as
clamavin two places:Startup:
services/_parent/runusess6-setuidgid clamav. That doesn't go through PAM, so it still works.Hourly: the cron entry from
clamav-unofficial-sigs.sh --install-cron. cron checks the account through PAM (/etc/pam.d/cronincludescommon-account, which usespam_unix), andpam_unixrefuses an expired account. I checked this in a container from the image with the expiry set and a cron job forclamavthat runs every minute. The job did not run, and the log shows:After clearing the expiry, the job ran the next minute:
CRON[175]: (clamav) CMD (touch /tmp/ran).So an image built now gets the clamav-unofficial-sigs signatures once at startup and never updates them until the container restarts. ClamAV's own signatures are not affected: freshclam and clamd run as services, not through cron.
The test suite catches this indirectly. Its clamav-unofficial-sigs tests use
su -s /bin/sh clamav, so 8 tests in the default suite (109–113, 137–139) fail on any fresh build withYour account has expired; please contact your system administrator./su: Authentication failure, whatever the branch.What is the new behavior (if this is a feature change) ?
The Dockerfile runs
usermod -e '' clamavright after installing the packages, which clears the expiry. The password stays locked (!*), so nobody can log in asclamav. Root can still switch to it withsu, and cron can still run jobs as it, as on 1.2.2. The rebuilt image's line isclamav:!*:20786::::::.A new test in the default suite checks that
chage -l clamavshowsAccount expires: never, so a future package that does the same thing fails with the cause in the test name, not only assuerrors in other tests.Type of change
Status
Todo List
How has this been tested ?
1f66fe0+ this commit): 140/140, including the 8 clamav-unofficial-sigs tests that fail on a fresh build of master, and the new expiry test.usermod -e 1 clamava once-a-minuteclamavjob was refused as shown above. Withusermod -e '' clamavit ran at the next minute.