summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-core-private.h
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2016-07-11 09:29:18 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2016-07-29 16:03:28 +0000
commit6ffcb24d227eae5a479caf45adb8037eceb6ae33 (patch)
tree1b7960fb3982be067ab5ebb3bcf799695c839ff8 /src/libostree/ostree-core-private.h
parentfb0bf27d100943311204c343d458f1fa9c3e6d65 (diff)
downloadostree-6ffcb24d227eae5a479caf45adb8037eceb6ae33.tar.gz
deltas: Handle untrusted checksums faster and more robustly
When reworking the ostree core [to use O_TMPFILE](https://github.com/ostreedev/ostree/pull/369), I hit an issue in the way the untrusted delta codepath ends up trying to re-open the file to checksum it. That's not possible with `O_TMPFILE` since the fd (which we opened `O_WRONLY`) is the only accessible reference to the content. Fix this by changing the delta processing code to update a checksum as we're doing writes, which is also faster, and ends up simplifying the code as well. What would be an even larger simplification here is if we e.g. used a separate thread calling `write_object()` or something like that; the main issue I see there is somehow bridging the fact that function wants a `GInputStream*` but the delta code is generating stream of writes. Closes: #392 Approved by: jlebon
Diffstat (limited to 'src/libostree/ostree-core-private.h')
-rw-r--r--src/libostree/ostree-core-private.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libostree/ostree-core-private.h b/src/libostree/ostree-core-private.h
index b49e5e47..cb4d953d 100644
--- a/src/libostree/ostree-core-private.h
+++ b/src/libostree/ostree-core-private.h
@@ -63,6 +63,10 @@ G_BEGIN_DECLS
*/
#define _OSTREE_ZLIB_FILE_HEADER_GVARIANT_FORMAT G_VARIANT_TYPE ("(tuuuusa(ayay))")
+
+GVariant *_ostree_file_header_new (GFileInfo *file_info,
+ GVariant *xattrs);
+
GVariant *_ostree_zlib_file_header_new (GFileInfo *file_info,
GVariant *xattrs);