Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jun 2001 19:30:52 +0200 (CEST)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: /usr/bin/host doesn't work in jail ...?
Message-ID:  <200106051730.TAA89438@lurza.secnetix.de>
In-Reply-To: <200106051225.OAA74361@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Sorry for replying to myself ...

Oliver Fromme <olli@secnetix.de> wrote:
 > Gerhard Sittig <Gerhard.Sittig@gmx.net> wrote:
 >  > BTW:  Wasn't there a bug in the gnats database about processes
 >  > failing (forgetting) to bind(2) their sockets to an address?
 >  > Search the PRs for "jail" to see if it's been fixed since.
 > 
 > Oh, hm, that might be it.  host and nslookup don't use
 > bind().
 > 
 > I'll dig into the source, add a bind() and see if that
 > changes anything.  *sigh*  There should be a sysctl or
 > something so that it binds automatically inside jails
 > if necessary.  I guess host/nslookup are not the only
 > programs which have problems ...  :-(
 > 
 > Maybe I find a possibility when looking at the kernel
 > sources involved.

In fact, I found out that a bind is performed internally
when a connect is done inside a prison and the socket has
not been bound before.  That code (for UDP) is at the
beginning of in_pcbconnect() in sys/netinet/in_pcb.c.

Now the interesting thing is:

I added two lines to that code for debugging.  Rebuilt
kernel, rebooted, and -- now host(1) and nslookup(1)
DO work fine inside a jail.

Then I removed the printfs again, rebuilt, rebooted --
it still works.  Even though it should be the same code
as initially.

-->  ?!?

I would _really_ like to know what was going on.  Just
to be sure that it cannot happen again.  :-(
Maybe some strange compiler bug?  (I'm working on an
Alpha/AXP box, by the way, not i386.)

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106051730.TAA89438>