]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/strtoday.c: strtoday(): Remove obsolete comment
authorAlejandro Colomar <alx@kernel.org>
Tue, 18 Feb 2025 14:43:29 +0000 (15:43 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Mon, 2 Jun 2025 07:59:51 +0000 (09:59 +0200)
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>
lib/strtoday.c

index cf77ca6fa3fe1d520812ae96ffc9f82b91639eab..6e0e55c704d0c58871c795373be0223fc0d47faa 100644 (file)
@@ -24,14 +24,8 @@ strtoday(const char *str)
        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.