Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 May 2002 12:21:29 +0200
From:      Gerhard Sittig <Gerhard.Sittig@gmx.net>
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>
In-Reply-To: <20020504230024.GA46653@darkstar.doublethink.cx>; from jedgar@fxp.org on Sat, May 04, 2002 at 07:00:24PM -0400
References:  <003b01c1f399$d7272fe0$0301a8c0@ec.rr.com> <20020504230024.GA46653@darkstar.doublethink.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
[ 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020505122129.V1494>