Commit 58139da
fix: mount to resolved symlink target path using readlink
Root cause: When mounting to /etc/resolv.conf (a symlink), mount follows the symlink
but our placeholder file might not be at the expected location in the mount namespace.
Solution: Use readlink -f to get the actual target path before mounting:
mount --bind /etc/netns/.../resolv.conf $(readlink -f /etc/resolv.conf || echo /etc/resolv.conf)
This ensures we mount to the correct location whether /etc/resolv.conf is a regular
file or a symlink.
Tested on ml-1 with external DNS (8.8.8.8) - all 23 tests pass, host resolv.conf
remains untouched.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 95ed568 commit 58139da
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
| 547 | + | |
548 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
549 | 552 | | |
550 | | - | |
| 553 | + | |
551 | 554 | | |
552 | 555 | | |
553 | 556 | | |
| |||
0 commit comments