Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/checkout: use canonical permissions in bare-user-only mode #2415

Merged
merged 2 commits into from
Aug 19, 2021

Conversation

lucab
Copy link
Member

@lucab lucab commented Aug 19, 2021

This adds a new OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS
checksumming flag, which is needed in bare-user-only mode
to ignore local IDs.
It also automatically enables canonical permissions for checkouts in
bare-user-only mode.

This adds a new `OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS`
checksumming flag, which is needed in bare-user-only mode
to ignore local IDs.
@lucab
Copy link
Member Author

lucab commented Aug 19, 2021

This locally passed a non-root make check run. I think the CI here does not have a job covering that.

ostree_repo_init repo init --mode=bare-user-only
rm files -rf && mkdir files
echo afile > files/afile
$OSTREE --repo=repo commit ${COMMIT_ARGS} -b perms files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be running ostree fsck here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, I've added it.
Although this PR is not the fix for #2410.
ostree fsck only happens to work here because ${COMMIT_ARGS} values let this test land on a happy path.

This automatically enables canonical permissions for checkouts in
bare-user-only mode.
@lucab lucab force-pushed the ups/checksum-canonical-perms branch from afaad7a to d41fcd1 Compare August 19, 2021 16:10
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

@@ -31,7 +31,7 @@ if is_bare_user_only_repo repo; then
# In bare-user-only repos we can only represent files with uid/gid 0, no
# xattrs and canonical permissions, so we need to commit them as such, or
# we end up with repos that don't pass fsck
COMMIT_ARGS="--canonical-permissions"
COMMIT_ARGS="--canonical-permissions --no-xattrs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is the bit we should be able to get rid of once we fix the commit side of this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is the same workaround we suggested at #2410 (comment).

@lucab lucab enabled auto-merge August 19, 2021 16:51
@lucab lucab merged commit 3209acb into ostreedev:main Aug 19, 2021
@lucab lucab deleted the ups/checksum-canonical-perms branch August 20, 2021 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants