diff -ruN bro/scripts/bro_config.in bro-work/scripts/bro_config.in --- bro/scripts/bro_config.in 2008-04-17 12:16:49.000000000 +0800 +++ bro-work/scripts/bro_config.in 2008-04-17 12:48:06.000000000 +0800 @@ -110,12 +110,7 @@ case $sys in Linux*) BRO_SYS_TYPE="LINUX";; Darwin*) BRO_SYS_TYPE="DARWIN";; - FreeBSD*) rtype=`uname -r` - case $rtype in - 4*) BRO_SYS_TYPE="FREEBSD4";; - 5*) BRO_SYS_TYPE="FREEBSD5";; - 6*) BRO_SYS_TYPE="FREEBSD6";; - esac;; + FreeBSD*) BRO_SYS_TYPE="FREEBSD";; *) BRO_SYS_TYPE="UNKNOWN";; esac } @@ -706,13 +701,10 @@ return fi - # FreeBSD 6 uses differnt var names - if [ "x$BRO_SYS_TYPE" = 'xFREEBSD6' ]; then + # FreeBSD uses differnt var names + if [ "x$BRO_SYS_TYPE" = 'xFREEBSD' ]; then MAXBUF='net.bpf.maxbufsize' BUFSZ='net.bpf.bufsize' - else - MAXBUF='debug.bpf_maxbufsize' - BUFSZ='debug.bpf_bufsize' fi @@ -819,23 +811,23 @@ } ###################################################################### -# FREEBSD5 isms (dang devfs bpf) +# FREEBSD isms (dang devfs bpf) # bro_config_freebsd_devfs() { # see if we've mucked with it before *dang* octothorp! - if [ -e /etc/rc.local ] ; then - foo=`grep "BRO BPF PERMISSIONS CHANGES" /etc/rc.local |sed s/#//g` + if [ -e /etc/devfs.rules ] ; then + foo=`grep "BRO BPF PERMISSIONS CHANGES" /etc/devfs.rules |sed s/#//g` if ! [ -z "$foo" ]; then - echo "Looks like /etc/rc.local has already been setup" - echo "Not changing /etc/rc.local" + echo "Looks like /etc/devfs.rules has already been setup" + echo "Not changing /etc/devfs.rules" return fi # see if they already have a policy bar=`grep "bpf" /etc/devfs.conf|sed s/#//g` if ! [ -z "$bar" ]; then echo "/etc/devfs.conf has policy for bpf devices already!" - echo "Not adding one to /etc/rc.local" + echo "Not adding one to /etc/devfs.rules" return fi @@ -844,23 +836,29 @@ brogroup=`grep ^$BRO_USER_ID /etc/group | awk -F: '{print $3}'` if [ -z $brogroup ] ; then echo "Can't find group for $BRO_USER_ID" - echo "Not changing /etc/rc.local" + echo "Not changing /etc/devfs.rules" return fi # always make a backup - cp /etc/rc.local /etc/rc.local.$$.bak > /dev/null 2>&1 + cp /etc/devfs.rules /etc/devfs.rules.$$.bak > /dev/null 2>&1 # do it -cat - >> /etc/rc.local << BAZ +cat - >> /etc/devfs.rules << BAZ # BRO BPF PERMISSIONS CHANGES -devfs ruleset 15 -devfs rule add 15 path 'bpf*' mode 660 user $brogroup +[brorules=15] +add path 'bpf*' mode 660 user $brogroup BAZ - echo "Added devfs line to /etc/rc.local" + echo "Added devfs line to /etc/devfs.rules" + + # enable a brorules ruleset + echo 'devfs_system_ruleset="brorules"' >> /etc/rc.conf + + # restart devfs + /etc/rc.d/devfs restart } ###################################################################### # Give a name for the user id to install everything under @@ -981,13 +979,7 @@ # check various system parameters bro_config_system_parms # Linux does not do bpf devices, skip these tests. - if [ "x$BRO_SYS_TYPE" = 'xFREEBSD4' ]; then - # configure the bpfs before doing the dump :-) - bro_config_run_bpf - # configure the bpfs to be group readable - bro_config_chown_bpf - fi - if [ "x$BRO_SYS_TYPE" = 'xFREEBSD5' -o "x$BRO_SYS_TYPE" = 'xFREEBSD6' ]; then + if [ "x$BRO_SYS_TYPE" = 'xFREEBSD' ]; then bro_config_freebsd_devfs fi # if perl doesn't exist, don't bother...