lib: Move bareuseronly verification into commit/core

Conceptually `ostree-repo-pull.c` should be be written using
just public APIs; we theoretically support building without HTTP
for people who just want to use the object store portion and
do their own fetching.

We have some nontrivial behaviors in the pull layer though; one
of those is the "bareuseronly" verification.  Make a new internal
API that accepts flags, move it into `commit.c`.  This
is prep for further work in changing object import to support
reflinks.

Closes: #1193
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-09-21 19:14:59 +00:00
1 parent d4c7093e37
commit 160864d557
9 files changed
+316 -288

No files matched your search

+13
View File
@@ -134,6 +134,19 @@ static inline char * _ostree_get_commitpartial_path (const char *checksum)
return g_strconcat ("state/", checksum, ".commitpartial", NULL);
}
gboolean
_ostree_validate_bareuseronly_mode (guint32 mode,
const char *checksum,
GError **error);
static inline gboolean
_ostree_validate_bareuseronly_mode_finfo (GFileInfo *finfo,
const char *checksum,
GError **error)
{
const guint32 content_mode = g_file_info_get_attribute_uint32 (finfo, "unix::mode");
return _ostree_validate_bareuseronly_mode (content_mode, checksum, error);
}
gboolean
_ostree_parse_delta_name (const char *delta_name,
char **out_from,