summaryrefslogtreecommitdiff
path: root/src/shared/json.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-23 15:25:42 +0200
committerLennart Poettering <lennart@poettering.net>2019-12-02 09:47:00 +0100
commitba23dbf1ebd9ac347e43540ee682c2744c52f3c3 (patch)
tree1ffb57feb8ea42ade898e5a8a7961a6f28ae177e /src/shared/json.h
parentd642f640bf39f9086a24920d97808fa40159a372 (diff)
downloadsystemd-ba23dbf1ebd9ac347e43540ee682c2744c52f3c3.tar.gz
json: optionally, make string checks stricter when dispatching strings
Diffstat (limited to 'src/shared/json.h')
-rw-r--r--src/shared/json.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/json.h b/src/shared/json.h
index d3e44d1b04..1ce0f90c29 100644
--- a/src/shared/json.h
+++ b/src/shared/json.h
@@ -230,10 +230,11 @@ typedef enum JsonDispatchFlags {
JSON_PERMISSIVE = 1 << 0, /* Shall parsing errors be considered fatal for this property? */
JSON_MANDATORY = 1 << 1, /* Should existence of this property be mandatory? */
JSON_LOG = 1 << 2, /* Should the parser log about errors? */
+ JSON_SAFE = 1 << 3, /* Don't accept "unsafe" strings in json_dispatch_string() + json_dispatch_string() */
/* The following two may be passed into log_json() in addition to the three above */
- JSON_DEBUG = 1 << 3, /* Indicates that this log message is a debug message */
- JSON_WARNING = 1 << 4, /* Indicates that this log message is a warning message */
+ JSON_DEBUG = 1 << 4, /* Indicates that this log message is a debug message */
+ JSON_WARNING = 1 << 5, /* Indicates that this log message is a warning message */
} JsonDispatchFlags;
typedef int (*JsonDispatchCallback)(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata);