Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Oct 2020 20:39:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 221613] pw expire_days have a bug
Message-ID:  <bug-221613-227-uGOut6YyTF@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-221613-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-221613-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221613

Andrew Daugherity <andrew.daugherity@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrew.daugherity@gmail.com

--- Comment #3 from Andrew Daugherity <andrew.daugherity@gmail.com> ---
I can confirm this is still an issue on 12.1.

I have in /etc/login.conf:
default:\
        [...]
        :passwordtime=3D1y:\
        :warnpassword=3D7d:

But this was not applied to newly-created accounts (regardless of using eit=
her
adduser or "pw useradd"), which had 0 in the sixth field of master.passwd,
meaning password expiration was ignored.

I first tried editing adduser.conf, adding 'upwexpire=3D1y', but then creat=
ing
users failed with the error "pw: Invalid date".  (I guess adduser calls pw
useradd internally, which makes sense.)  I then tried the example straight =
out
of adduser.conf(5) of 'upwexpire=3D91d', which also fails.  A bare number d=
oes
work, but gets copied directly to the change field of master.passwd, rather
than being converted to epoch-relative time.

Similarly, setting 'password_days =3D 365' in pw.conf, makes users get a li=
teral
365 in master.passwd, just like Andres' report.


Workaround: Don't set password_days in pw.conf, but immediately after user
creation, set the expiration time with "pw usermod -p"; date(1) can help
convert relative dates to the epoch format, e.g. for 60 days in the future:
    pw useradd $USER ...
    pw usermod $USER -p `date -v +60d +%s`

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-221613-227-uGOut6YyTF>