]> dgit.raspbian.org Git - git-annex.git/commit
assistant: Fix a race condition that could cause a pointer file to get ingested into...
authorJoey Hess <joeyh@joeyh.name>
Tue, 2 Jul 2024 16:24:57 +0000 (12:24 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 2 Jul 2024 16:25:30 +0000 (12:25 -0400)
commit12a0ca9656a5a7025aa2bbd7171b60c3c2b764be
treeffbf7f4423d931771f5100e003717339ea60d77c
parenta65068fb66f2f6d28c570921a4ee909cced80d9e
assistant: Fix a race condition that could cause a pointer file to get ingested into the annex

This was caused by commit fb8ab2469d389e5b1e554831eeb8b7c7a072d5d7 putting
an isPointerFile check in the wrong place. So if the file was not a pointer
file at that point, but got replaced by one before the file got locked
down, the pointer file would be ingested into the annex.

The fix is simply to move the isPointerFile check to after safeToAdd locks
down the file. Now if the file changes to a pointer file after the
isPointerFile check, ingestion will see that it changed after lockdown,
and will refuse to add it to the annex.

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
Assistant/Threads/Committer.hs
Assistant/Threads/Watcher.hs
CHANGELOG
doc/bugs/assistant___40__webapp__41___commited_unlocked_link_to_annex.mdwn
doc/bugs/assistant___40__webapp__41___commited_unlocked_link_to_annex/comment_7_44ab02fd027efc56ce8bb701e5513b1d._comment [new file with mode: 0644]