lib/checkout: Add bareuseronly_dirs option

This is a continuation of https://github.com/ostreedev/ostree/pull/926
for directories instead of files.

See: https://github.com/flatpak/flatpak/issues/845

This option suppresses mode bits outside of `0775` for directory
checkouts.  I think most people should start doing this by default,
and use explicit overrides for e.g. `/tmp` if doing a recommit based
on a checkout.

Closes: #927
Approved by: alexlarsson
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-06-13 20:05:31 +00:00
1 parent 6ed824bf00
commit 0635fcbfd9
4 files changed
+27 -6

No files matched your search

+3 -3
View File
@@ -751,11 +751,11 @@ checkout_tree_at_recurse (OstreeRepo *self,
{
guint32 canonical_mode;
/* Silently ignore world-writable directories (plus sticky, suid bits,
* etc.) when doing a checkout for bare-user-only repos. This is related
* to the logic in ostree-repo-commit.c for files.
* etc.) when doing a checkout for bare-user-only repos, or if requested explicitly.
* This is related to the logic in ostree-repo-commit.c for files.
* See also: https://github.com/ostreedev/ostree/pull/909 i.e. 0c4b3a2b6da950fd78e63f9afec602f6188f1ab0
*/
if (self->mode == OSTREE_REPO_MODE_BARE_USER_ONLY)
if (self->mode == OSTREE_REPO_MODE_BARE_USER_ONLY || options->bareuseronly_dirs)
canonical_mode = (mode & 0775) | S_IFDIR;
else
canonical_mode = mode;
+2 -1
View File
@@ -768,7 +768,8 @@ typedef struct {
gboolean process_whiteouts;
gboolean no_copy_fallback;
gboolean force_copy; /* Since: 2017.6 */
gboolean unused_bools[6];
gboolean bareuseronly_dirs; /* Since: 2017.7 */
gboolean unused_bools[5];
const char *subpath;