Commit d2923af
committed
Bugfix: Fix crash on launch after auto-update
The new, custom auto-updater was absolutely broken! Luckily, the fix was simple:
- `fs::copy` overwrites files in-place, keeping the same inode. macOS's kernel code signing cache is keyed by inode, so it validates the new binary's pages against the old binary's cached code directory → `SIGKILL (Code Signature Invalid)` before any app code runs.
- Fix: write to a temp file, then `rename()` into place. This creates a new inode, forcing the kernel to validate the code signature fresh.
- The admin-privilege path (`rsync -a`) already uses atomic rename by default, so only the direct-write path was affected.1 parent d0746fb commit d2923af
2 files changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
174 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
| |||
0 commit comments