-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) ap_expr: Add filemod function for checking file modification dates
+ [Daniel Gruno]
+
*) SECURITY: CVE-2014-8109 (cve.mitre.org)
mod_lua: Fix handling of the Require line when a LuaAuthzProvider is
used in multiple Require directives with different arguments.
return "0";
}
+static const char *filemod_func(ap_expr_eval_ctx_t *ctx, const void *data,
+ char *arg)
+{
+ apr_finfo_t sb;
+ if (apr_stat(&sb, arg, APR_FINFO_MIN, ctx->p) == APR_SUCCESS
+ && sb.filetype == APR_REG && sb.mtime > 0)
+ return apr_psprintf(ctx->p, "%" APR_OFF_T_FMT, sb.mtime);
+ else
+ return "0";
+}
+
+
static const char *unescape_func(ap_expr_eval_ctx_t *ctx, const void *data,
const char *arg)
{
{ unescape_func, "unescape", NULL, 0 },
{ file_func, "file", NULL, 1 },
{ filesize_func, "filesize", NULL, 1 },
+ { filemod_func, "filemod", NULL, 1 },
{ base64_func, "base64", NULL, 0 },
{ unbase64_func, "unbase64", NULL, 0 },
{ sha1_func, "sha1", NULL, 0 },