Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dllinject: Track actual attribute writes instead of the requesting flag
Opening a file with the `FILE_WRITE_ATTRIBUTES` access right merely *requests* write access to attributes, and does not constitute a write in itself. Previously, this caused issues with tools that need to specify this flag for whatever reason, but didn't actually write or change the attributes of the files they opened with this flag. If those tools lie outside the source tree, Tup will in fact delete all of these files, forcing you to either reinstall the tool or recover the missing files from a backup. (Thankfully, write-protecting the compiler's directory prevents this from succeeding!) This change should still address the node.js use case that initially prompted the check for `FILE_WRITE_ATTRIBUTES` in c7160c8. I couldn't find a definitive list of everything that counts as "attributes", but it does seem to be limited to the timestamps and attribute bits covered by the `FILE_BASIC_INFORMATION` structure.
- Loading branch information