json: add flags parameter to json_parse_file(), for parsing "sensitive" data

This will call json_variant_sensitive() internally while parsing for
each allocated sub-variant. This is better than calling it a posteriori
at the end, because partially parsed variants will always be properly
erased from memory this way.
This commit is contained in:
Lennart Poettering
2019-12-02 09:47:00 +01:00
parent f325aaf341
commit d642f640bf
6 changed files with 32 additions and 21 deletions
+1 -1
View File
@@ -2214,7 +2214,7 @@ int oci_load(FILE *f, const char *bundle, Settings **ret) {
path = strjoina(bundle, "/config.json");
r = json_parse_file(f, path, &oci, &line, &column);
r = json_parse_file(f, path, 0, &oci, &line, &column);
if (r < 0) {
if (line != 0 && column != 0)
return log_error_errno(r, "Failed to parse '%s' at %u:%u: %m", path, line, column);