Skip to content

Commit f56bca0

Browse files
committed
add a warning to the --check doc
1 parent 8bec2fb commit f56bca0

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 generate a checkfile with something like
15+
> `b3sum my_dir/* > CHECKFILE`, then `b3sum --check CHECKFILE` will succeed
16+
> even after _new files_ are added to `my_dir`. Adding new files without
17+
> changing anything else is often enough to execute arbitrary code, for example
18+
> by shadowing an `import` in Python, or by installing something in
19+
> `.git/hooks`. This is confusing enough that I don't recommend using `--check`
20+
> as a security tool in 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)