From: Alexander Larsson Date: Wed, 24 Feb 2016 14:17:46 +0000 (+0100) Subject: deltas: Fix regression in ostree_repo_static_delta_execute_offline X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~493^2^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1833142b14255f5ddf0fd2b991a4b5aa5a6ecc92;p=ostree.git deltas: Fix regression in ostree_repo_static_delta_execute_offline xdg-app passed this a filename directly, and in this case it should be used as is. This regressed to always look for "superblock" in the same directory as the passed in filename. https://bugzilla.gnome.org/show_bug.cgi?id=762617 --- diff --git a/src/libostree/ostree-repo-static-delta-core.c b/src/libostree/ostree-repo-static-delta-core.c index eb6de3bb..ea5842f7 100644 --- a/src/libostree/ostree-repo-static-delta-core.c +++ b/src/libostree/ostree-repo-static-delta-core.c @@ -240,6 +240,7 @@ ostree_repo_static_delta_execute_offline (OstreeRepo *self, g_autoptr(GVariant) fallback = NULL; g_autofree char *to_checksum = NULL; g_autofree char *from_checksum = NULL; + g_autofree char *basename = NULL; dir_or_file_path = gs_file_get_path_cached (dir_or_file); @@ -255,13 +256,16 @@ ostree_repo_static_delta_execute_offline (OstreeRepo *self, else { g_autofree char *dir = dirname (g_strdup (dir_or_file_path)); + basename = g_path_get_basename (dir_or_file_path); if (!glnx_opendirat (AT_FDCWD, dir, TRUE, &dfd, error)) goto out; } } + else + basename = g_strdup ("superblock"); - meta_fd = openat (dfd, "superblock", O_RDONLY | O_CLOEXEC); + meta_fd = openat (dfd, basename, O_RDONLY | O_CLOEXEC); if (meta_fd < 0) { glnx_set_error_from_errno (error);