diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index 9f48c311..30bda716 100644 --- a/src/libostree/ostree-core.c +++ b/src/libostree/ostree-core.c @@ -684,9 +684,12 @@ ostree_create_file_from_input (GFile *dest_file, if (g_cancellable_set_error_if_cancelled (cancellable, error)) return FALSE; - if (finfo != NULL && !is_archived_content) + if (finfo != NULL) { mode = g_file_info_get_attribute_uint32 (finfo, "unix::mode"); + /* Archived content files should always be 0644 */ + if (is_archived_content) + mode = (mode & S_IFMT) | 0644; } else { diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 3dbdc4d6..67057d52 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -938,8 +938,9 @@ impl_stage_archive_file_object_from_raw (OstreeRepo *self, cancellable, error)) goto out; - if (ret_checksum) + if (out_checksum) { + g_assert (ret_checksum); ostree_checksum_update_stat (ret_checksum, g_file_info_get_attribute_uint32 (file_info, "unix::uid"), g_file_info_get_attribute_uint32 (file_info, "unix::gid"),