Commit e211658
fix(extensions): preserve config file mode on keep-config restore
Per review: config files can hold secrets, so recreating them with
write_bytes() (default perms) could widen access. Capture the original
st_mode alongside the bytes and re-apply it (permission bits) after
restore, matching the --force path's shutil.copy2 mode preservation.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 08c7e70 commit e211658
2 files changed
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1404 | 1404 | | |
1405 | 1405 | | |
1406 | 1406 | | |
1407 | | - | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
1408 | 1412 | | |
1409 | 1413 | | |
1410 | 1414 | | |
| |||
1415 | 1419 | | |
1416 | 1420 | | |
1417 | 1421 | | |
1418 | | - | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1419 | 1426 | | |
1420 | 1427 | | |
1421 | 1428 | | |
| |||
1424 | 1431 | | |
1425 | 1432 | | |
1426 | 1433 | | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
1432 | 1445 | | |
1433 | 1446 | | |
1434 | 1447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1568 | 1568 | | |
1569 | 1569 | | |
1570 | 1570 | | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
1571 | 1574 | | |
1572 | 1575 | | |
1573 | 1576 | | |
| |||
1579 | 1582 | | |
1580 | 1583 | | |
1581 | 1584 | | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
1582 | 1588 | | |
1583 | 1589 | | |
1584 | 1590 | | |
| |||
0 commit comments