Support for "bare-user" repo format
This format is pretty much the same as the "bare" format, except the file ownership and xattrs is not stored in the actual filesystem object, but rather on the side in a user xattr. This means two things: 1) An unprivileged user can store such a repo independent of the types of files in it or their xattrs. And you can later (as root) reconstruct the real filesystem tree with ownership. Although you can't do that using hardlink-sharing. This also means ostree fsck does a full verification. 2) Such a repository can be checked out with user-mode (checkout -U) as an unprivileged user using hardlinks for space sharing. Additionally, symlinks are stored as regular files (with the content being the symlink target) because user xattrs are not supported on symlinks. We know at checkout time if the file is a symlink because the original st_mode is stored in the xattr metadata. https://bugzilla.gnome.org/show_bug.cgi?id=741125
This commit is contained in:
1 parent
26a47b9cca
commit
47c612e5a0
4 files changed
+210
-21
No files matched your search
@@ -324,7 +324,7 @@ checkout_file_hardlink (OstreeRepo *self,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
gboolean ret_was_supported = FALSE;
|
||||
int srcfd = self->mode == OSTREE_REPO_MODE_BARE ?
|
||||
int srcfd = (self->mode == OSTREE_REPO_MODE_BARE || self->mode == OSTREE_REPO_MODE_BARE_USER) ?
|
||||
self->objects_dir_fd : self->uncompressed_objects_dir_fd;
|
||||
|
||||
again:
|
||||
@@ -401,8 +401,10 @@ checkout_one_file_at (OstreeRepo *repo,
|
||||
|
||||
while (current_repo)
|
||||
{
|
||||
gboolean is_bare = (current_repo->mode == OSTREE_REPO_MODE_BARE
|
||||
&& mode == OSTREE_REPO_CHECKOUT_MODE_NONE);
|
||||
gboolean is_bare = ((current_repo->mode == OSTREE_REPO_MODE_BARE
|
||||
&& mode == OSTREE_REPO_CHECKOUT_MODE_NONE) ||
|
||||
(current_repo->mode == OSTREE_REPO_MODE_BARE_USER
|
||||
&& mode == OSTREE_REPO_CHECKOUT_MODE_USER));
|
||||
gboolean is_archive_z2_with_cache = (current_repo->mode == OSTREE_REPO_MODE_ARCHIVE_Z2
|
||||
&& mode == OSTREE_REPO_CHECKOUT_MODE_USER
|
||||
&& current_repo->enable_uncompressed_cache);
|
||||
|
||||
Reference in new issue
Block a user