Skip to content

Commit

Permalink
Ensure that bundles have metadata on install
Browse files Browse the repository at this point in the history
If we have a bundle without metadata we wouldn't properly present
the permissions in the transaction.
  • Loading branch information
alexlarsson committed Jan 12, 2022
1 parent 93357d3 commit 65cbfac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common/flatpak-dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 65cbfac

Please sign in to comment.