ujail: DNS regression with a standalone /etc/resolv.conf after 3f61bf11
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c, linux
- Ambito
- backend, operating-systems
Direzione di ricerca
Start by reading the resolv_conf_link_target() logic described in the issue and the host-network jail mount handling in procd. Compare how it handles a standalone /etc/resolv.conf with one resolving into /tmp/resolv.conf.d, then reproduce both cases using the supplied ujail commands. Done means the jail uses the host resolver in both cases while directory sharing still reflects resolver updates.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Commit 3f61bf11b41a — jail: share the live resolv.conf with host-network jails causes host-network jails to use a different resolver configuration from the host when /etc/resolv.conf is a standalone file.
On my router, this prevents jailed sysntpd from resolving its NTP server. The daemon remains running, but the clock is never synchronized.
Environment
- OpenWrt SNAPSHOT
r38095-df5dc61652 - Target:
mediatek/filogic - Architecture:
aarch64_cortex-a53 - procd-ujail:
2026.11.03~fb611687-r1 - dnsmasq DNS service disabled with
option port '0'
The host has a standalone /etc/resolv.conf containing:
nameserver 114.114.114.114
Meanwhile, /tmp/resolv.conf.d/resolv.conf contains:
nameserver 127.0.0.1
nameserver ::1
No DNS server listens on localhost. DNS resolution works on the host using /etc/resolv.conf.
Reproduction
With the configuration above:
cat /etc/resolv.conf
ujail -n resolver-default -U ntp -G ntp -c \
-r /bin/cat \
-- /bin/cat /etc/resolv.conf
ujail -n resolver-explicit -U ntp -G ntp -c \
-r /bin/cat -r /etc/resolv.conf \
-- /bin/cat /etc/resolv.conf
Actual output:
# Host
nameserver 114.114.114.114
# Jail with default resolver handling
nameserver 127.0.0.1
nameserver ::1
# Jail with explicit /etc/resolv.conf mount
nameserver 114.114.114.114
Expected behavior
A jail sharing the host network should honor the host's /etc/resolv.conf, including when it is a standalone file.
Directory sharing should preserve updates when the host resolver points into /tmp/resolv.conf.d, without overriding an independent resolver configuration.
Suspected cause
Before 3f61bf11, the host-network jail path called:
add_mount_bind("/etc/resolv.conf", 1, 0);
The new resolv_conf_link_target() first checks whether /tmp/resolv.conf.d/resolv.conf exists:
if (!access(HOST_RESOLV_CONF_DIR "/resolv.conf", F_OK))
return strdup(".." JAIL_RESOLV_CONF_DIR "/resolv.conf");
This returns before checking realpath("/etc/resolv.conf"). Consequently, the existence of the generated file overrides a standalone host /etc/resolv.conf.
The installed fb611687 source contains this logic, and the runtime behavior above reproduces it.
A possible fix is to check the resolved host /etc/resolv.conf path first, using directory sharing only when that path lies within /tmp/resolv.conf.d. Otherwise, retain the file bind mount.
Workaround and verification
Adding the following immediately after procd_add_jail ntpd ubus in /etc/init.d/sysntpd works around the issue:
procd_add_jail_mount /etc/resolv.conf
After restarting sysntpd, the jail sees the correct resolver and the daemon automatically synchronizes the clock.
A separate read-only NTP query inside a jail with the explicit resolver mount successfully resolved ntp.aliyun.com and reported an offset within approximately ±2 ms after synchronization.
- Lingua principale
- C
- Stelle
- 13
- Fork
- 49
- Merge medio
- 11g 12h
- PR unite (30g)
- 3
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openwrt/procd
-
watchdog: ping frequency can exceed the timeout the driver acceptedForse già presa @thc1006 l’ha presa 24 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 15/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 4 giorni
-
uxc: veth setup issuesAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
openwrt/procd#38 · 4 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di openwrt/procd
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
FujiNetWIFI/fujinet-config#379 ·
I maintainer di solito rispondono entro 1 giorno
-
Ship /Local/Applications, the Local domain's Applications folderForse già presa @pkgdemon l’ha presa oggi. Apertaarea:base enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
nextbsd/nextbsd-userland#612 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
zephyrproject-rtos/zephyr#125543 ·
I maintainer di solito rispondono entro 2 giorni
-
good first issue needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
InauguralSystems/EigenScript#2347 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
colbymchenry/codegraph#3277 ·
I maintainer di solito rispondono entro 1 giorno