Commit af77366
committed
Set restrictive file permissions for seed file
Previously, seed files were created using `fs::File::create()` which
inherits the default umask, potentially making the sensitive seed
material world-readable on Unix systems.
This change:
- Creates seed files with mode 0o600 (owner read/write only) on Unix
- Uses `create_new` instead of `create` to atomically fail if the file
already exists, providing defense-in-depth against TOCTOU race
conditions
Co-Authored-By: Claude AI1 parent 690d1f4 commit af77366
1 file changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
81 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| |||
0 commit comments