core: Map metadata from repository as trusted
ot_util_variant_map() assumed untrusted; add a boolean, and use it for the repository internals.
This commit is contained in:
1 parent
cf53ed5cef
commit
f95090095e
8 files changed
+70
-33
No files matched your search
@@ -108,10 +108,11 @@ ot_util_variant_take_ref (GVariant *variant)
|
||||
* Note the returned @out_variant is not floating.
|
||||
*/
|
||||
gboolean
|
||||
ot_util_variant_map (GFile *src,
|
||||
ot_util_variant_map (GFile *src,
|
||||
const GVariantType *type,
|
||||
GVariant **out_variant,
|
||||
GError **error)
|
||||
gboolean trusted,
|
||||
GVariant **out_variant,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
const char *path = NULL;
|
||||
@@ -126,7 +127,7 @@ ot_util_variant_map (GFile *src,
|
||||
ret_variant = g_variant_new_from_data (type,
|
||||
g_mapped_file_get_contents (mfile),
|
||||
g_mapped_file_get_length (mfile),
|
||||
FALSE,
|
||||
trusted,
|
||||
(GDestroyNotify) g_mapped_file_unref,
|
||||
mfile);
|
||||
mfile = NULL;
|
||||
|
||||
Reference in new issue
Block a user