How to temporarily leave fakeroot environment
0
votes
1
answer
588
views
To run some tests, I want to revoke write permissions for a folder. This is a minimal example:
$ mkdir test
$ chmod a-w test
$ touch test/test || printf '%s\n' "write permissions successfully revoked"
touch: cannot touch 'test/test': Permission denied
write permissions successfully revoked
However, if I run it with fakeroot, this doesn't work:
$ fakeroot sh
# mkdir test
# chmod a-w test
# touch test/test || printf '%s\n' "write permissions successfully revoked"
# ls test
test
For an explanation **why** this doesn't work, see this question, for example: https://unix.stackexchange.com/questions/538045/issue-with-changing-permissions/538051
However, my question is: how can I get around this? Can I temporarily disable fakeroot for the chmod
command? Or can I make fakeroot permission changes permanent anyway?
Asked by finefoot
(3554 rep)
Apr 20, 2020, 06:06 PM
Last activity: Apr 20, 2020, 06:17 PM
Last activity: Apr 20, 2020, 06:17 PM