aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-08 18:22:57 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-08 18:22:57 +0000
commitf3277faf934a449ca680ba4ce4c3b98906b22af0 (patch)
tree838be8fe33ab82490d72e68ecd38e31c59ce9a86 /contrib
parentfbd00a3d375fdad377f7adc76fcb77a515b3d2e0 (diff)
downloadrspamd-f3277faf934a449ca680ba4ce4c3b98906b22af0.tar.gz
rspamd-f3277faf934a449ca680ba4ce4c3b98906b22af0.zip
[Minor] Trace glob includes
Diffstat (limited to 'contrib')
-rw-r--r--contrib/libucl/ucl_util.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/contrib/libucl/ucl_util.c b/contrib/libucl/ucl_util.c
index fdd0862cc..11799ab1e 100644
--- a/contrib/libucl/ucl_util.c
+++ b/contrib/libucl/ucl_util.c
@@ -1394,7 +1394,9 @@ ucl_include_file_single (const unsigned char *data, size_t len,
*/
static bool
ucl_include_file (const unsigned char *data, size_t len,
- struct ucl_parser *parser, struct ucl_include_params *params)
+ struct ucl_parser *parser,
+ struct ucl_include_params *params,
+ const ucl_object_t *args)
{
const unsigned char *p = data, *end = data + len;
bool need_glob = false;
@@ -1424,6 +1426,20 @@ ucl_include_file (const unsigned char *data, size_t len,
return (!params->must_exist || false);
}
for (i = 0; i < globbuf.gl_pathc; i ++) {
+
+ if (parser->include_trace_func) {
+ const ucl_object_t *parent = NULL;
+
+ if (parser->stack) {
+ parent = parser->stack->obj;
+ }
+
+ parser->include_trace_func (parser, parent, NULL,
+ globbuf.gl_pathv[i],
+ strlen (globbuf.gl_pathv[i]),
+ parser->include_trace_ud);
+ }
+
if (!ucl_include_file_single ((unsigned char *)globbuf.gl_pathv[i],
strlen (globbuf.gl_pathv[i]), parser, params)) {
if (params->soft_fail) {
@@ -1565,7 +1581,7 @@ ucl_include_common (const unsigned char *data, size_t len,
}
else if (data != NULL) {
/* Try to load a file */
- return ucl_include_file (data, len, parser, &params);
+ return ucl_include_file (data, len, parser, &params, args);
}
}
else {
@@ -1580,7 +1596,7 @@ ucl_include_common (const unsigned char *data, size_t len,
snprintf (ipath, sizeof (ipath), "%s/%.*s", ucl_object_tostring(param),
(int)len, data);
if ((search = ucl_include_file (ipath, strlen (ipath),
- parser, &params))) {
+ parser, &params, args))) {
if (!params.allow_glob) {
break;
}