-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix operations on read-only files when running unprivileged.
Fixes #307
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
test $(id -u) -gt 0 | ||
|
||
rm -rf unpriv-test | ||
mkdir unpriv-test | ||
|
||
cd unpriv-test | ||
|
||
mkdir lower upper workdir merged | ||
|
||
touch lower/a lower/b | ||
chmod 444 lower/a lower/b | ||
|
||
fuse-overlayfs -o lowerdir=lower,upperdir=upper,workdir=workdir merged | ||
|
||
rm -f merged/a | ||
chmod 406 merged/b | ||
|
||
test \! -e merged/a | ||
test $(stat --printf=%a merged/b) -eq 406 | ||
test $(stat --printf=%a upper/b) -eq 406 | ||
if [ ${FUSE_OVERLAYFS_DISABLE_OVL_WHITEOUT:-0} -eq 1 ]; then | ||
test -e upper/.wh.a | ||
else | ||
test -c upper/a | ||
fi | ||
|
||
fusermount -u merged || [ $? -eq "${EXPECT_UMOUNT_STATUS:-0}" ] |