get_date() doesn't treat "" as a date anymore, so the comment is
obsolete. We still need the code, though, as for example usermod(8)
uses an empty string as a synonym for -1.
Link: <https://github.com/shadow-maint/shadow/pull/1217#issuecomment-
2668174079>
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
long d;
time_t t;
- /*
- * get_date() interprets an empty string as the current date,
- * which is not what we expect, unless you're a BOFH :-).
- * (useradd sets sp_expire = current date for new lusers)
- */
- if ((NULL == str) || streq(str, "")) {
+ if (NULL == str || streq(str, ""))
return -1;
- }
/* If a numerical value is provided, this is already a number of
* days since EPOCH.