Ensure that bundles have metadata on install

If we have a bundle without metadata we wouldn't properly present
the permissions in the transaction.
This commit is contained in:
Alexander Larsson
2022-01-12 11:00:56 +01:00
committed by Alexander Larsson
parent 93357d3571
commit 65cbfac982

View File

@@ -9372,6 +9372,13 @@ flatpak_dir_ensure_bundle_remote (FlatpakDir *self,
if (metadata == NULL)
return NULL;
/* If we rely on metadata (to e.g. print permissions), check it exists before creating the remote */
if (out_metadata && fp_metadata == NULL)
{
flatpak_fail_error (error, FLATPAK_ERROR_INVALID_DATA, "No metadata in bundler header");
return NULL;
}
gpg_data = extra_gpg_data ? extra_gpg_data : included_gpg_data;
deploy_data = flatpak_dir_get_deploy_data (self, ref, FLATPAK_DEPLOY_VERSION_ANY, cancellable, NULL);