From owner-freebsd-current@FreeBSD.ORG Tue Aug 9 22:21:25 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2BB116A41F; Tue, 9 Aug 2005 22:21:25 +0000 (GMT) (envelope-from stb@lassitu.de) Received: from schlepper.zs64.net (schlepper.zs64.net [212.12.50.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id C456843D5F; Tue, 9 Aug 2005 22:21:24 +0000 (GMT) (envelope-from stb@lassitu.de) Received: from [IPv6:::1] (schlepper [212.12.50.230]) by schlepper.zs64.net (8.13.1/8.12.9) with ESMTP id j79MLLkH074958; Wed, 10 Aug 2005 00:21:21 +0200 (CEST) (envelope-from stb@lassitu.de) In-Reply-To: <20050809220809.GD928@zaphod.nitro.dk> References: <96153776-0BE4-456F-B573-042E84730DFE@lassitu.de> <20050809220809.GD928@zaphod.nitro.dk> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4204340F-B78E-4913-8B0A-563335266EA9@lassitu.de> Content-Transfer-Encoding: 7bit From: Stefan Bethke Date: Wed, 10 Aug 2005 00:21:17 +0200 To: "Simon L. Nielsen" X-Mailer: Apple Mail (2.733) Cc: drvince@anonymnet.net, freebsd-current@FreeBSD.org Subject: Re: More into /etc/rc.d/jail X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2005 22:21:25 -0000 Am 10.08.2005 um 00:08 schrieb Simon L. Nielsen: > On 2005.08.09 23:30:26 +0200, Stefan Bethke wrote: > >> sed -e 's/#.*$//' <${mdconfig_conf} |grep -v '^[[:space:]]*$' >> >/tmp/mdconfig.$$ > > Try searching the web for "temporary file symlink attack"... (hint: > creating temorary files like that is bad, use mktemp). Again, thanks for the hint. This was meant as a starting point; it was hacked together as a stop-gap measure in twenty minutes. (And has persisted over six months now...) As to the actual problem: - It should run late in the startup sequence, so cleantmp should have run. - I cribbed the use directly off some other script... let's see... ah, it's /etc/rc.d/jail. - The host for all the jails should be inaccessible for anyone except myself and my admin colleague. (And yes, there's no services running there apart from sshd.) I would be more than happy for someone else taking this script, polishing it, and getting it committed, so I don't have to rememeber not nuking it on the next mergemaster :-) Cheers, Stefan -- Stefan Bethke Fon +49 170 346 0140