Stop further socket() or connect() calls.

Oliver Fromme olli at
Tue Jul 11 14:27:41 UTC 2006

mal content < at> wrote:
 > I was looking for a way to write a small wrapper program
 > that disables network access and then exec()'s a given
 > program.

Sorry for the late reply, but ...  The easiest way to do
what you described is to run the program in a jail which
has a jail IP that doesn't exist and isn't routed.  Then
the program cannot perform any network access.

For example:  jail / foo /your/program

All attempts to access the network should result in an
error "no route to host" (errno EHOSTUNREACH).

Best regards

Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD:
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

C++: "an octopus made by nailing extra legs onto a dog"
        -- Steve Taylor, 1998

More information about the freebsd-hackers mailing list