From owner-freebsd-stable Sun Nov 25 9: 6:21 2001 Delivered-To: freebsd-stable@freebsd.org Received: from horsey.gshapiro.net (horsey.gshapiro.net [209.220.147.178]) by hub.freebsd.org (Postfix) with ESMTP id D576F37B41B; Sun, 25 Nov 2001 09:06:14 -0800 (PST) Received: from horsey.gshapiro.net (gshapiro@localhost [IPv6:::1]) by horsey.gshapiro.net (8.12.2.Beta1/8.12.2.Beta1) with ESMTP id fAPH6Cgv063820 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 25 Nov 2001 09:06:12 -0800 (PST) Received: (from gshapiro@localhost) by horsey.gshapiro.net (8.12.2.Beta1/8.12.2.Beta1/Submit) id fAPH6CDW063817; Sun, 25 Nov 2001 09:06:12 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15361.9475.891401.44730@horsey.gshapiro.net> Date: Sun, 25 Nov 2001 09:06:11 -0800 From: Gregory Neil Shapiro To: Evan Sarmiento Cc: freebsd-stable@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: jail patch In-Reply-To: <200111251659.fAPGxpi13194@csa.bu.edu> References: <200111251659.fAPGxpi13194@csa.bu.edu> X-Mailer: VM 6.96 under 21.5 (beta3) "asparagus" XEmacs Lucid Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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