-
Notifications
You must be signed in to change notification settings - Fork 305
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
repo: Add checksum to error message opening unreadable object #1564
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,24 @@ trap _tmpdir_cleanup EXIT | |
/usr/libexec/installed-tests/libostree/test-basic.sh | ||
/usr/libexec/installed-tests/libostree/test-basic-c | ||
date | ||
|
||
# Test error message when opening a non-world-readable object | ||
# https://github.com/ostreedev/ostree/issues/1562 | ||
rm repo -rf | ||
chmod a+rx . | ||
ostree --repo=repo init --mode=bare | ||
mkdir files | ||
touch files/unreadable | ||
chmod 0 files/unreadable | ||
ostree --repo=repo commit -b testbranch --tree=dir=files | ||
# We should be able to read as non-root due to CAP_DAC_OVERRIDE | ||
ostree --repo=repo ls testbranch >/dev/null | ||
cat >upriv.sh <<EOF | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't look used anywhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, fixup for all of these ⬇️ |
||
#!/bin/bash | ||
set -xeuo pipefail | ||
ostree --repo=testclone | ||
EOF | ||
if setpriv --reuid bin --regid bin --clear-groups ostree --repo=repo cat testbranch /unreadable 2>err.txt; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be more convinced if we did the exact same |
||
fatal "Listed unreadable object as non-root" | ||
fi | ||
assert_file_has_content err.txt "Opening content object.*openat: Permission denied" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should say "read as root", right?