Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Nov 2001 09:06:11 -0800
From:      Gregory Neil Shapiro <gshapiro@FreeBSD.ORG>
To:        Evan Sarmiento <evms@cs.bu.edu>
Cc:        freebsd-stable@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG
Subject:   Re: jail patch
Message-ID:  <15361.9475.891401.44730@horsey.gshapiro.net>
In-Reply-To: <200111251659.fAPGxpi13194@csa.bu.edu>
References:  <200111251659.fAPGxpi13194@csa.bu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
evms> I wrote this a while ago, but, if anyone is interested, please
evms> take a look: this module implements a system call that takes
evms> a u_int_32t. This system call, named killjail, kills all processes
evms> which belong to the jail which uses that particular IP address.

evms> I included it in a tar with a makefile and with a program
evms> that uses it. (Eg: ./killjail 1.2.3.4)

evms> http://www.sekt7.org/kjs.tar

evms> Works on 4.4 but can be easily ported to 5.0.

This can be done in userland without kernel interaction:

#!/bin/sh

EX_OK=0
EX_USAGE=64

if [ "$1" = "" ]
then
	echo "Usage: $0 jailname"
	exit ${EX_USAGE}
fi

pids=`grep -l " $1\$" /proc/*/status | awk -F/ '{print $3}'`
if [ "$pids" != "" ]
then
	kill -15 $pids 2> /dev/null
fi
exit ${EX_OK}

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?15361.9475.891401.44730>