Commit 351e23c
authored
fix: harden rescue staging dir - symlink checks, secure writes, cleanup errors
- Thread 14: Change except BaseException to except Exception in the staging
fallback block so KeyboardInterrupt/SystemExit propagate correctly
- Thread 15: Add explanatory comment to the bare pass in the chmod except
block to satisfy static analysis
- Thread 16: Reject a symlinked staging directory and only reload
non-symlinked files whose names match the two recognised config suffixes
- Thread 17: Create each staging file via os.open with mode 0600 and
O_CREAT|O_EXCL before writing so preserved bytes are never transiently
exposed to other local users
- Thread 18: Remove ignore_errors=True from the final staging-dir cleanup
so a failed rmtree propagates rather than silently leaving a stale
backup that could be misread on the next retry
Assisted-by: GitHub Copilot (model: claude-sonnet-4.6, autonomous)1 parent 0f366c0 commit 351e23c
1 file changed
Lines changed: 27 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1410 | 1410 | | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | | - | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
1414 | 1418 | | |
1415 | 1419 | | |
1416 | 1420 | | |
1417 | 1421 | | |
1418 | | - | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
1419 | 1425 | | |
1420 | | - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1421 | 1431 | | |
1422 | 1432 | | |
1423 | 1433 | | |
| |||
1442 | 1452 | | |
1443 | 1453 | | |
1444 | 1454 | | |
1445 | | - | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1446 | 1463 | | |
1447 | 1464 | | |
1448 | 1465 | | |
1449 | | - | |
1450 | | - | |
| 1466 | + | |
| 1467 | + | |
1451 | 1468 | | |
1452 | 1469 | | |
1453 | 1470 | | |
| |||
1498 | 1515 | | |
1499 | 1516 | | |
1500 | 1517 | | |
1501 | | - | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
1502 | 1521 | | |
1503 | | - | |
| 1522 | + | |
1504 | 1523 | | |
1505 | 1524 | | |
1506 | 1525 | | |
| |||
0 commit comments