[Pkg-shadow-devel] Bug#1021697: usermod or chage cannot read a valid account expiration date

Jelle van der Waa jelle at vdwaa.nl
Thu Oct 13 09:09:52 BST 2022


Package: shadow
Version: 1:4.12.3+dfsg1-1

TL;DR https://github.com/shadow-maint/shadow/issues/564

After the shadow update 1:4.11.1+dfsg1-2 -> 1:4.12.3+dfsg1-1, usermod or 
chage is unable to set an account expiration date, /etc/shadow is 
changed succsesfully. Reproducer:

useradd scruffy -s /bin/bash -c scruffy
echo scruffy:foobar | chpasswd

root at debian:~# grep scruffy /etc/shadow
scruffy:$y$j9T$1fstz5tURDw3e6S.opJnI.$9vHoS3GogDEiw.aT.hc/6fXsDaJKpFucIBP3RaNeVV0:19278:0:99999:7:::

root at debian:~# chage -l scruffy
Last password change                                    : %b %d, %Y
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : %b %d, %Y

root at debian:~# usermod -e 2022-11-12 scruffy
root at debian:~# chage -l scruffy
Last password change                                    : %b %d, %Y
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : %b %d, %Y

root at debian:~# grep scruffy /etc/shadow
scruffy:$y$j9T$1fstz5tURDw3e6S.opJnI.$9vHoS3GogDEiw.aT.hc/6fXsDaJKpFucIBP3RaNeVV0:19278:0:99999:7::19308:

The last second last field contains the account expiration date "19308".

On Debian stable this works:

root at debian:~# chage -l scruffy
Last password change                                    : Oct 13, 2022
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never

root at debian:~# usermod -e 2022-11-12 scruffy

root at debian:~# chage -l scruffy
Last password change                                    : Oct 13, 2022
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : Nov 12, 2022

root at debian:~# grep scruffy /etc/shadow
scruffy:$y$j9T$dNsOFo7bJ.ptWQnpVg/MO.$xMnvSP2uVI.JpoKa2.PsveCvjKmDi24Fq1QaUg45L9A:19278:0:99999:7::19308:

This seems to have fixed upstream: 
https://github.com/shadow-maint/shadow/issues/564

In commit 
https://github.com/shadow-maint/shadow/commit/e503fd574b7dbf6b21b1168e20938f0922807916



More information about the Pkg-shadow-devel mailing list