From 376c9d7effa01fa020711a3f12829fe9b18b8bca Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Wed, 15 Mar 2023 21:33:21 -0500 Subject: [PATCH] core: Ensure glib standard::size attribute is always set * A recent change in glib [1] requires that the appropriate attribute be available when calling getters. ostree core only sets this attribute on regular files, and frequently triggers the critical warning. Solve this by setting standard::size to zero for non-regular files. Fixes https://github.com/ostreedev/ostree/issues/2827 [1]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3261 --- src/libostree/ostree-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index 56b381d9..0d1b0d5d 100644 --- a/src/libostree/ostree-core.c +++ b/src/libostree/ostree-core.c @@ -1739,6 +1739,8 @@ _ostree_stbuf_to_gfileinfo (const struct stat *stbuf) if (S_ISREG (mode)) g_file_info_set_attribute_uint64 (ret, "standard::size", stbuf->st_size); + else + g_file_info_set_attribute_uint64 (ret, "standard::size", 0); return ret; }