lib/commit: disallow writing content in 'bare-split-xattrs' mode

This prevents writing content into 'bare-split-xattrs` repository,
while carving some space for experimenting via a temporary
`OSTREE_EXP_WRITE_BARE_SPLIT_XATTRS` environment flag.
This commit is contained in:
Luca BRUNO committed 2022-03-02 16:45:02 +00:00
1 parent 14a6e6d8d0
commit 7e79b82ff8
2 files changed
+25

No files matched your search

+3
View File
@@ -920,6 +920,9 @@ write_content_object (OstreeRepo *self,
return FALSE;
OstreeRepoMode repo_mode = ostree_repo_get_mode (self);
if (repo_mode == OSTREE_REPO_MODE_BARE_SPLIT_XATTRS &&
g_getenv ("OSTREE_EXP_WRITE_BARE_SPLIT_XATTRS") == NULL)
return glnx_throw (error, "Not allowed due to repo mode");
GInputStream *file_input; /* Unowned alias */
g_autoptr(GInputStream) file_input_owned = NULL; /* We need a temporary for bare-user symlinks */