Skip to content

Commit c54ee7e

Browse files
committed
add a warning to the --check doc
1 parent 2f341f1 commit c54ee7e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

b3sum/what_does_check_do.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ complicated than it might seem, is that representing filepaths as text means we
88
need to consider many possible edge cases of unrepresentable filepaths. This
99
document describes all of these edge cases in detail.
1010

11+
> [!CAUTION]
12+
> `b3sum --check` (like all the Coreutils `--check` features) tells you whether
13+
> some _filepaths_ have changed, but it can't tell you whether a _directory_
14+
> has changed in general. If you create a checkfile with something like `b3sum
15+
> my_dir/* > CHECKFILE`, then `b3sum --check CHECKFILE` will succeed even after
16+
> _new files_ are added to `my_dir`. Adding new files without changing anything
17+
> else is often enough to execute arbitrary code, for example by shadowing an
18+
> `import` in Python, or by installing something in `.git/hooks`. This is
19+
> confusing enough that I don't recommend using `--check` as a security tool in
20+
> new code.
21+
1122
## The simple case
1223

1324
Here's the result of running `b3sum a b c/d` in a directory that contains

0 commit comments

Comments
 (0)