Fix _ostree_ensure_fsverity reporting of supports in early exit
authorAlexander Larsson <alexl@redhat.com>
Wed, 15 May 2024 15:31:09 +0000 (17:31 +0200)
committerAlexander Larsson <alexl@redhat.com>
Wed, 15 May 2024 15:31:09 +0000 (17:31 +0200)
commit083eacd6de914ab8b1a950333c5e9c137f3bd67c
treea2d2756ace418c02959a4daa50ac0ee3093edac4
parentf911d40b986182d0d34b9c94d0d1b987da61d1ed
Fix _ostree_ensure_fsverity reporting of supports in early exit

If supported_out is passed to _ostree_ensure_fsverity and we
successfully exit early, for example because the file is a symlink, then
*supported_out is not initialized.

This is problematic in the case of ostree_sysroot_update_post_copy(),
because it passes in an uninitialized supported, and on successfull
return of _ostree_ensure_fsverity() it assumes that it is iniialized.

In case supported happened to be initialized to non-zero it will take
this branch:

      if (!supported)
        break; /* If not supported, skip rest */

Which means *all* further objects will not get fs-verity enabled.
src/libostree/ostree-repo-verity.c