Merge pull request #2412 from lucab/ups/lib-commit-canonicalize
lib/commit: autofix permissions for bare-user-only
This commit is contained in:
4 files changed
+40
-11
No files matched your search
+1
-1
@@ -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 --no-xattrs"
|
||||
COMMIT_ARGS="--no-xattrs"
|
||||
DIFF_ARGS="--owner-uid=0 --owner-gid=0 --no-xattrs"
|
||||
# Also, since we can't check out uid=0 files we need to check out in user mode
|
||||
CHECKOUT_U_ARG="-U"
|
||||
|
||||
@@ -25,7 +25,7 @@ set -euo pipefail
|
||||
|
||||
mode="bare-user-only"
|
||||
setup_test_repository "$mode"
|
||||
extra_basic_tests=6
|
||||
extra_basic_tests=7
|
||||
. $(dirname $0)/basic-test.sh
|
||||
|
||||
$CMD_PREFIX ostree --version > version.yaml
|
||||
@@ -112,3 +112,15 @@ $OSTREE checkout --force-copy perms out
|
||||
$OSTREE checkout ${CHECKOUT_H_ARGS} --union-identical perms out
|
||||
$OSTREE fsck
|
||||
echo "ok checkout checksum with canonical perms"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
rm repo -rf
|
||||
ostree_repo_init repo init --mode=bare-user-only
|
||||
rm files -rf && mkdir files
|
||||
echo afile > files/afile
|
||||
$OSTREE commit ${COMMIT_ARGS} -b perms files
|
||||
rm out -rf
|
||||
$OSTREE checkout --force-copy perms out
|
||||
$OSTREE checkout ${CHECKOUT_H_ARGS} --union-identical perms out
|
||||
$OSTREE fsck
|
||||
echo "ok automatic canonical perms for bare-user-only"
|
||||
Reference in new issue
Block a user