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:
1 parent
6ed824bf00
commit
0635fcbfd9
4 files changed
+27
-6
No files matched your search
+17
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "1..$((68 + ${extra_basic_tests:-0}))"
|
||||
echo "1..$((69 + ${extra_basic_tests:-0}))"
|
||||
|
||||
$CMD_PREFIX ostree --version > version.yaml
|
||||
python -c 'import yaml; yaml.safe_load(open("version.yaml"))'
|
||||
@@ -445,6 +445,22 @@ assert_file_has_content checkout-test-union-add/union-add-test 'existing file fo
|
||||
assert_file_has_content checkout-test-union-add/union-add-test2 'another file for union add testing'
|
||||
echo "ok checkout union add"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
rm files -rf && mkdir files
|
||||
mkdir files/worldwritable-dir
|
||||
chmod a+w files/worldwritable-dir
|
||||
$CMD_PREFIX ostree --repo=repo commit -b content-with-dir-world-writable --tree=dir=files
|
||||
rm dir-co -rf
|
||||
$CMD_PREFIX ostree --repo=repo checkout -U -H -M content-with-dir-world-writable dir-co
|
||||
assert_file_has_mode dir-co/worldwritable-dir 775
|
||||
if ! is_bare_user_only_repo repo; then
|
||||
rm dir-co -rf
|
||||
$CMD_PREFIX ostree --repo=repo checkout -U -H content-with-dir-world-writable dir-co
|
||||
assert_file_has_mode dir-co/worldwritable-dir 777
|
||||
fi
|
||||
rm dir-co -rf
|
||||
echo "ok checkout bareuseronly dir"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
rm -rf shadow-repo
|
||||
mkdir shadow-repo
|
||||
|
||||
Reference in new issue
Block a user