]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make 'utc = yes' works for converting strings into unix timestamp
authorBoris Lytochkin <lytboris@yandex-team.ru>
Mon, 23 Nov 2020 20:21:42 +0000 (23:21 +0300)
committerAlan DeKok <aland@freeradius.org>
Mon, 23 Nov 2020 20:45:32 +0000 (15:45 -0500)
as well.

src/modules/rlm_date/rlm_date.c

index 86a7d6220f989e2e38ff058afda61efc2fb51ee0..79191e73d87d17d3f30cabac27b2ca69ba5d5c0f 100644 (file)
@@ -95,7 +95,11 @@ static ssize_t xlat_date_convert(void *instance, REQUEST *request, char const *f
                        goto error;
                }
 
-               date = mktime(&tminfo);
+               if (!inst->utc) {
+                       date = mktime(&tminfo);
+               } else {
+                       date = timegm(&tminfo);
+               }
                if (date < 0) {
                        REDEBUG("Failed converting parsed time into unix time");