init: check for filesystem where write bit cannot be removed
authorJoey Hess <joeyh@joeyh.name>
Wed, 1 Sep 2021 14:27:28 +0000 (10:27 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 1 Sep 2021 14:27:28 +0000 (10:27 -0400)
commit6329997ac44691937f1d7fe6a71da3184237b13b
tree1417bca3e67b21623f6890092ac6ac2d755ae697
parent9a0eab9b0ee1c8f740070b1213b6ca7ee9c70091
init: check for filesystem where write bit cannot be removed

This fixes a reversion caused by a99a84f3420a1d93e4ecd4b8cf30638b48e2758e,
when git-annex init is run as root on a FAT filesystem mounted with
hdiutil on OSX. Such a mount point has file mode 777 for everything and
it cannot be changed. The existing crippled filesystem test tried to
write to a file after removing write bit, but that test does not run as
root (since root can write to unwritable files). So added a check of the
write permissions of the file, after attempting to remove them.

Sponsored-by: Dartmouth College's Datalad project
Annex/Init.hs
Annex/Perms.hs
doc/bugs/2_mac_crippled_FS__58___Unable_to_remove_all_write.mdwn
doc/bugs/2_mac_crippled_FS__58___Unable_to_remove_all_write/comment_1_22a1f4b025a6046e4d11f90590a6e4bd._comment [new file with mode: 0644]