From: Alan T. DeKok Date: Tue, 14 Jun 2022 21:54:05 +0000 (-0500) Subject: allow %{date:} as a synonym for %{date:now} X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8dc5d36a786243ceae40f3856344f4f38ff2a6f;p=thirdparty%2Ffreeradius-server.git allow %{date:} as a synonym for %{date:now} --- diff --git a/src/modules/rlm_date/rlm_date.c b/src/modules/rlm_date/rlm_date.c index ddebcdc4df9..4e8fd27acfa 100644 --- a/src/modules/rlm_date/rlm_date.c +++ b/src/modules/rlm_date/rlm_date.c @@ -175,6 +175,8 @@ static xlat_action_t xlat_date_convert(TALLOC_CTX *ctx, fr_dcursor_t *out, memset(&tminfo, 0, sizeof(tminfo)); + if (!arg) goto now; + /* * Certain strings have magical meanings. */ @@ -185,6 +187,7 @@ static xlat_action_t xlat_date_convert(TALLOC_CTX *ctx, fr_dcursor_t *out, } if (strcmp(arg->vb_strvalue, "now") == 0) { + now: return date_encode_strftime(ctx, out, inst, request, fr_time_to_sec(fr_time())); } }