On Wed, 7 Dec 2005, Ted Unangst wrote:
> On 12/7/05, Federico Giannici <[EMAIL PROTECTED]> wrote:
> > > May it be relevant that the program is run chrootted???
> > >
> > > I'm going to make some tests, as soon as I have the time...
> >
> > Got it!
> > I simply copied "/etc/resolv.conf" to the chrootted path and the
> > problem disappeared.
> >
> > So something changed beetween 3.7 and 3.8 in the way /etc/resolv.conf is
> > accessed...
>
> i made some changes to the resolver, though they should deal with this
> situation (unless there's a bug).
I only grepped through the code of openser briefly, but this scenario
seems likely.
1. App calls res_init() which calls _res_init(1); _resp->restimespe
does not get set
2. App calls gethostbyname(), all is fine.
3. App does chroot.
4. App calls gethostbyname(), which calls _res_init(0). Let's assume
the recheck is done. The stat() will fail, but since _resp->restimespec
is not set, it will fall through and try to read /etc/resolv.conf from
within the chroot.
-Otto