From 4efb44f35a099c54b9e2895cea9622a97ab6d638 Mon Sep 17 00:00:00 2001 From: Rogerio Guerra Borin Date: Tue, 12 Mar 2024 17:02:58 -0300 Subject: [PATCH] deploy: Ensure boot directory is open before accessing it This fixes a bug in the (early) deployment pruning function which before tried to access the boot directory without opening it first. Signed-off-by: Rogerio Guerra Borin --- src/libostree/ostree-sysroot-deploy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 5d2d729bf0..f777b92f0d 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -2641,6 +2641,9 @@ auto_early_prune_old_deployments (OstreeSysroot *self, GPtrArray *new_deployment if (self->booted_deployment == NULL) return TRUE; + if (!_ostree_sysroot_ensure_boot_fd (self, error)) + return FALSE; + { struct stat stbuf; if (!glnx_fstatat (self->boot_fd, ".", &stbuf, 0, error))