summaryrefslogtreecommitdiffstats
path: root/src/modules/rlm_detail
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:41:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:41:52 +0000
commit44eafeee62e6982131c62df6f74335114ca53024 (patch)
tree1cdf833b0a76e52630d717202398ced5900e11e9 /src/modules/rlm_detail
parentAdding upstream version 3.2.3+dfsg. (diff)
downloadfreeradius-44eafeee62e6982131c62df6f74335114ca53024.tar.xz
freeradius-44eafeee62e6982131c62df6f74335114ca53024.zip
Adding upstream version 3.2.5+dfsg.upstream/3.2.5+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/modules/rlm_detail')
-rw-r--r--src/modules/rlm_detail/rlm_detail.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/rlm_detail/rlm_detail.c b/src/modules/rlm_detail/rlm_detail.c
index 036549f..949811c 100644
--- a/src/modules/rlm_detail/rlm_detail.c
+++ b/src/modules/rlm_detail/rlm_detail.c
@@ -64,6 +64,8 @@ typedef struct detail_instance {
bool escape; //!< do filename escaping, yes / no
+ bool dates_as_integer;
+
xlat_escape_t escape_func; //!< escape function
exfile_t *ef; //!< Log file handler
@@ -79,6 +81,7 @@ static const CONF_PARSER module_config[] = {
{ "permissions", FR_CONF_OFFSET(PW_TYPE_INTEGER, rlm_detail_t, perm), "0600" },
{ "group", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_detail_t, group), NULL },
{ "locking", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rlm_detail_t, locking), "no" },
+ { "dates_as_integer", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rlm_detail_t, dates_as_integer), "no" },
{ "escape_filenames", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rlm_detail_t, escape), "no" },
{ "log_packet_header", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rlm_detail_t, log_srcdst), "no" },
CONF_PARSER_TERMINATOR
@@ -317,7 +320,12 @@ static int detail_write(FILE *out, rlm_detail_t *inst, REQUEST *request, RADIUS_
*/
op = vp->op;
vp->op = T_OP_EQ;
- vp_print(out, vp);
+
+ if ((vp->da->type == PW_TYPE_DATE) && inst->dates_as_integer) {
+ WRITE("\t%s = %u\n", vp->da->name, vp->vp_date);
+ } else {
+ vp_print(out, vp);
+ }
vp->op = op;
}
}
@@ -336,7 +344,7 @@ static int detail_write(FILE *out, rlm_detail_t *inst, REQUEST *request, RADIUS_
}
#endif
}
- WRITE("\tTimestamp = %ld\n", (unsigned long) request->timestamp);
+ WRITE("\tTimestamp = %lu\n", (unsigned long) request->timestamp);
WRITE("\n");