bin/commit: Add '=' to --statoverride

Previously, we only supported additions in the statoverride file;
it was mainly for adding the setuid bit without having that physically
on disk.

However, for testing a change to `bare-user` handling around *unreadable*
files (which happens for `/etc/shadow` in host content), I need a way
to write that into a repo in the test suite.

I'm not actually aware of a non-test-suite use case for this; a more
sophisticated user is going to be using the API directly, which can already do
this. But we need it for tests at least.

Closes: #989
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-06-30 21:23:48 +00:00
1 parent e3a540a606
commit cd7d35945a
2 files changed
+37 -11

No files matched your search

+4
View File
@@ -342,8 +342,11 @@ cd ${test_tmpdir}
cat > test-statoverride.txt <<EOF
+1048 /a/nested/2
2048 /a/nested/3
=384 /a/readable-only
EOF
cd ${test_tmpdir}/checkout-test2-4
echo readable only > a/readable-only
chmod 664 a/readable-only
$OSTREE commit ${COMMIT_ARGS} -b test2-override -s "with statoverride" --statoverride=../test-statoverride.txt
cd ${test_tmpdir}
$OSTREE checkout test2-override checkout-test2-override
@@ -354,6 +357,7 @@ else
test '!' -g checkout-test2-override/a/nested/2
test '!' -u checkout-test2-override/a/nested/3
fi
assert_file_has_mode checkout-test2-override/a/readable-only 600
echo "ok commit statoverride"
cd ${test_tmpdir}