configlet icon indicating copy to clipboard operation
configlet copied to clipboard

consider improving some TOCTOU subtleties

Open ee7 opened this issue 3 years ago • 2 comments

For example, if a user:

  1. Runs configlet sync -u --tests -e foo
  2. Waits at the prompt
  3. Changes the tests.toml file for exercise foo in their track directory, e.g. adding include = false to a test.
  4. Continues going through configlet prompts until completion

If I recall correctly, configlet sync still works, and ignores that the file was changed. We could document this, or consider producing a warning if the file was modified since read-time. But it's probably tricky (and not worth trying) to support arbitrary changes to a file that we're asking questions about.

ee7 avatar May 15 '22 11:05 ee7

TOCTOU
Tme Of Check to Time Of Use

kotp avatar May 15 '22 17:05 kotp

But it's probably tricky (and not worth trying) to support arbitrary changes to a file that we're asking questions about.

I'd happily not consider this edge case at all. If people are running configlet to update files, and then start editing those files whilst doing that, I don't think we need to detect that in order to provide "sane" behavior.

ErikSchierboom avatar May 17 '22 08:05 ErikSchierboom