Commit b6cf570
committed
fix: eliminate TOCTOU races in ln and tac by deferring is_dir() checks
ln: call hard_link() first, check is_dir() only on failure for diagnostics
tac: remove is_dir()/metadata() pre-checks, open file directly and let OS report errors (EISDIR, ENOENT)
Closes #94501 parent 399118e commit b6cf570
1 file changed
Lines changed: 4 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
21 | 19 | | |
22 | 20 | | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
| |||
0 commit comments