lib/commit: always validate metadata
This tweaks commit logic in order to always validate metadata, including on commits where the expected checksum is already known.
This commit is contained in:
parent
a05b02fa9c
commit
6230b3eeab
|
|
@ -2478,12 +2478,8 @@ ostree_repo_write_metadata (OstreeRepo *self,
|
||||||
normalized = g_variant_get_normal_form (object);
|
normalized = g_variant_get_normal_form (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For untrusted objects, verify their structure here */
|
if (!_ostree_validate_structureof_metadata (objtype, object, error))
|
||||||
if (expected_checksum)
|
return FALSE;
|
||||||
{
|
|
||||||
if (!_ostree_validate_structureof_metadata (objtype, object, error))
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_autoptr(GBytes) vdata = g_variant_get_data_as_bytes (normalized);
|
g_autoptr(GBytes) vdata = g_variant_get_data_as_bytes (normalized);
|
||||||
if (!write_metadata_object (self, objtype, expected_checksum,
|
if (!write_metadata_object (self, objtype, expected_checksum,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue