From owner-freebsd-security Sun May 5 6:15:39 2002 Delivered-To: freebsd-security@freebsd.org Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by hub.freebsd.org (Postfix) with SMTP id 29A9A37B408 for ; Sun, 5 May 2002 06:15:30 -0700 (PDT) Received: (qmail 13267 invoked by uid 0); 5 May 2002 13:15:28 -0000 Received: from p50910363.dip0.t-ipconnect.de (HELO mail.gsinet.sittig.org) (80.145.3.99) by mail.gmx.net (mp007-rz3) with SMTP; 5 May 2002 13:15:28 -0000 Received: (qmail 81429 invoked from network); 5 May 2002 10:21:35 -0000 Received: from shell.gsinet.sittig.org (192.168.11.153) by mail.gsinet.sittig.org with SMTP; 5 May 2002 10:21:35 -0000 Received: (from sittig@localhost) by shell.gsinet.sittig.org (8.11.3/8.11.3) id g45ALT881416 for freebsd-security@FreeBSD.org; Sun, 5 May 2002 12:21:29 +0200 (CEST) (envelope-from sittig) Date: Sun, 5 May 2002 12:21:29 +0200 From: Gerhard Sittig To: freebsd-security@FreeBSD.org Subject: Re: MAKEDEV not run from `pwd` (was: Jail() in 4.6-pre*) Message-ID: <20020505122129.V1494@shell.gsinet.sittig.org> Mail-Followup-To: freebsd-security@FreeBSD.org References: <003b01c1f399$d7272fe0$0301a8c0@ec.rr.com> <20020504230024.GA46653@darkstar.doublethink.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020504230024.GA46653@darkstar.doublethink.cx>; from jedgar@fxp.org on Sat, May 04, 2002 at 07:00:24PM -0400 Organization: System Defenestrators Inc. Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org [ should this discussion move to a different list? which one? ] On Sat, May 04, 2002 at 19:00 -0400, Chris Faulhaber wrote: > > [ ... no /path/to/jail/dev/MAKEDEV available ... ] > > This appears to be related to changes made in etc/Makefile revs. > 1.219.2.27/1.247 where NO_MAKEDEV does not install MAKEDEV anymore > instead of only not running 'sh MAKEDEV all'. It appears we need to > MFC src/usr.sbin/jail/jail.8 rev. 1.24 to reflect this. > > For the present time, use: > > # make distribution DESTDIR=$D -DNO_MAKEDEV_RUN > > to get ${jaildir}/dev/MAKEDEV installed (or install it manually) > then rerun: > > # cd $D/dev > # sh MAKEDEV jail There could have been another workaround: MAKEDEV creates all the device nodes in the current directory, but it could easily be invoked without copying it around (after all MAKEDEV will be run in the host environment since jails don't allow to create device nodes). So I thought of a command like `cd $D/dev && sh /dev/MAKEDEV jail`. But having a closer look I see MAKEDEV does some kind of recursion: ----- snip ----- [ ... ] all) sh MAKEDEV std # standard sh MAKEDEV fd0 fd1 # bdev, floppy disk [ ... ] ----- snap ----- Should this read "...; sh $0 std; ..." or "ME=$0; ...; sh ${ME} std; ..." in case parameters get 'shift'ed? Or more cleanly and easier used in the .local case (untested) ----- snip ----- #!/bin/sh MKDEVDIR=`dirname $0` MAKEDEV=${MAKEDEV:-${MKDEVDIR}/MAKEDEV} export MAKEDEV [ ... ] all) sh ${MAKEDEV} std [ ... ] local) umask 0 # XXX should be elsewhere sh ${MAKEDEV}.local umask 77 ;; [ ... ] ----- snap ----- Should I file a conf(?) PR after making sure syntax is correct and test cases work? Who is using the .local hook and can tell wether this file *has* to live next to the MAKEDEV script or should be searched in the `pwd` first before falling back to `dirname $0`? And who else wants to invoke MAKEDEV without or prior to installing it in the target directory where all the device nodes live? mergemaster in prebuild mode maybe (in case the build or install steps need vn nodes or something)? virtually yours 82D1 9B9C 01DC 4FB4 D7B4 61BE 3F49 4F77 72DE DA76 Gerhard Sittig true | mail -s "get gpg key" Gerhard.Sittig@gmx.net -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message