Commit adada80
fix: create resolv.conf in chroot when not mounted (#549)
* fix: create resolv.conf in chroot when not mounted
When using selective /etc mounts in chroot mode, /etc/resolv.conf is not
included in the mount list. This causes DNS queries inside the chroot to
fall back to the host's systemd-resolved (127.0.0.53), which is blocked
by iptables (only 8.8.8.8, 8.8.4.4, 127.0.0.11 are allowed). As a
result, agents like Codex cannot resolve domains like api.openai.com.
Fix: when /host/etc/resolv.conf doesn't exist, create it from the
container's /etc/resolv.conf (which already has the correct AWF DNS
config). Clean up on exit by removing the created file.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use curl -f in chroot HTTP blocking test
The test used curl -s which silently receives Squid's 403 error page
(a valid HTTP response, exit 0). Use curl -f instead, which returns
non-zero for HTTP 4xx/5xx responses. This matches the pattern used in
the non-chroot integration tests (protocol-support.test.ts).
Previously this test only passed because DNS was broken in chroot mode,
causing curl to fail at DNS resolution rather than actually testing
HTTP blocking behavior.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e2b6482 commit adada80
2 files changed
Lines changed: 24 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
169 | 175 | | |
170 | | - | |
| 176 | + | |
171 | 177 | | |
172 | 178 | | |
173 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
174 | 187 | | |
175 | 188 | | |
176 | 189 | | |
| |||
291 | 304 | | |
292 | 305 | | |
293 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
294 | 311 | | |
295 | 312 | | |
296 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
0 commit comments