You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chage -E, usermod -e: dates other than YYYY-MM-DD are rejected #365
chage -E and usermod -e (and useradd -e) accept only YYYY-MM-DD or a day count. GNU 4.17.4 reads the date with its general date parser, so other common forms work:
# chage -E 01/02/2030 alice
GNU: exit 0, expire = 21916 (2030-01-02)
here: invalid date '01/02/2030' (expected YYYY-MM-DD or days since epoch), exit 2
Same for 2030/01/02, 1/2/30, 2 Jan 2030, January 2, 2030 and tomorrow, which GNU all takes; usermod -e 01/02/2030 exits 3 here. Scripts written for GNU that pass a date in one of these forms stop working.
The parsing is in shadow-core/src/date.rs. uutils/parse_datetime already reads the GNU date -d forms; would using it there be welcome? I can send a PR.
Checked on main 7a84527 in ubuntu:26.04 (GNU passwd 1:4.17.4-2ubuntu3).
Confirmed against Debian's shadow 4.17.4: all the forms you list are accepted there. parse_datetime is fine as a dependency (MIT, and jiff/winnow pass our licence policy). Keep YYYY-MM-DD, a plain day count and -1 behaving exactly as today, and add tests for each form you list. A PR is welcome once the clean-room confirmation I asked for on #370 is in, and within the three-open-PRs limit.
@jayhemnani9910 are you still planning a PR for this one? The clean-room confirmation is in, so it's open to you. If you'd rather not, say so and we'll pick it up.
Activity
pierre-warnier commentedon Oct 28, 2026
Confirmed against Debian's shadow 4.17.4: all the forms you list are accepted there. parse_datetime is fine as a dependency (MIT, and jiff/winnow pass our licence policy). Keep
YYYY-MM-DD, a plain day count and-1behaving exactly as today, and add tests for each form you list. A PR is welcome once the clean-room confirmation I asked for on #370 is in, and within the three-open-PRs limit.pierre-warnier commentedon Nov 3, 2026
@jayhemnani9910 are you still planning a PR for this one? The clean-room confirmation is in, so it's open to you. If you'd rather not, say so and we'll pick it up.
jayhemnani9910 commentedon Nov 3, 2026
No, I won't get to this one. Please go ahead, and thanks for checking.
CHANGELOG: expiry dates in the forms date -d takes (#365)
CHANGELOG: expiry dates in the forms date -d takes (#365)