Code

frontend, parser: Allow typed access to host objects from any context.
[sysdb.git] / src / parser / analyzer.c
index 01539edbe71f870de8486b52320caa6dd9fa4444..e03cbdbc3d2e9ff259e9d18f6729bf9751e920b7 100644 (file)
@@ -347,7 +347,7 @@ analyze_typed(int context, sdb_ast_typed_t *t, sdb_strbuf_t *errbuf)
 
        /* self-references are allowed and services and metrics may reference
         * their parent host; everything may reference attributes */
 
        /* 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)) {
                        && (((context != SDB_SERVICE) && (context != SDB_METRIC))
                                || (t->type != SDB_HOST))
                        && (t->type != SDB_ATTRIBUTE)) {