summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cc35394)
raw | patch | inline | side by side (parent: cc35394)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 15 May 2015 19:41:14 +0000 (21:41 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 15 May 2015 19:41:14 +0000 (21:41 +0200) |
That is, even from the "generic" or "filter" contexts.
src/frontend/analyzer.c | patch | blob | history | |
src/parser/analyzer.c | patch | blob | history |
index 4bd370222e8e11d4a41e9a3b297a1e35412155be..01e1ad357adec6502fc7efc74768bee7cdf03969 100644 (file)
--- a/src/frontend/analyzer.c
+++ b/src/frontend/analyzer.c
if (context == (int)e->data.data.integer)
return 0;
if ((e->data.data.integer == SDB_HOST) &&
- ((context == SDB_SERVICE) || (context == SDB_METRIC)))
+ ((context == SDB_SERVICE) || (context == SDB_METRIC)
+ || (context < 0)))
return 0;
sdb_strbuf_sprintf(errbuf, "Invalid expression %s.%s "
"in %s context",
diff --git a/src/parser/analyzer.c b/src/parser/analyzer.c
index 01539edbe71f870de8486b52320caa6dd9fa4444..e03cbdbc3d2e9ff259e9d18f6729bf9751e920b7 100644 (file)
--- a/src/parser/analyzer.c
+++ b/src/parser/analyzer.c
/* self-references are allowed and services and metrics may reference
* their parent host; everything may reference attributes */
- if ((context != t->type) && (context != UNSPEC_CONTEXT)
+ if ((context != t->type) && (context > 0)
&& (((context != SDB_SERVICE) && (context != SDB_METRIC))
|| (t->type != SDB_HOST))
&& (t->type != SDB_ATTRIBUTE)) {