FreeBSD Bugzilla – Attachment 46783 Details for
Bug 71732
net/isc-dhcp3-servre (4.x devfs fix)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 7.02 KB, created by
Cyrille Lefevre
on 2004-09-14 17:30:24 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Cyrille Lefevre
Created:
2004-09-14 17:30:24 UTC
Size:
7.02 KB
patch
obsolete
>diff -ruN -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ /tmp/ports/net/isc-dhcp3-server/Makefile /usr/ports/net/isc-dhcp3-server/Makefile >--- Makefile.orig Tue Sep 14 17:23:21 2004 >+++ Makefile Tue Sep 14 17:54:02 2004 >@@ -8,7 +8,7 @@ > > PORTNAME= dhcp > PORTVERSION= 3.0.1.r14 >-PORTREVISION= 4 >+PORTREVISION= 5 > CATEGORIES= net > MASTER_SITES= ${MASTER_SITE_ISC} > MASTER_SITE_SUBDIR= dhcp dhcp/dhcp-3.0-history >diff -ruN -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ /tmp/ports/net/isc-dhcp3-server/files/isc-dhcpd.sh.sample /usr/ports/net/isc-dhcp3-server/files/isc-dhcpd.sh.sample >--- files/isc-dhcpd.sh.sample.orig Fri Aug 20 13:52:33 2004 >+++ files/isc-dhcpd.sh.sample Tue Sep 14 17:42:14 2004 >@@ -29,6 +29,7 @@ > dhcpd_withgroup=${dhcpd_withgroup:-${name}} # group name to run as > > dhcpd_chroot_enable=${dhcpd_chroot_enable:-"NO"} # runs chrooted? >+dhcpd_devfs_enable=${dhcpd_devfs_enable:-"YES"} # devfs if available? > dhcpd_rootdir=${dhcpd_rootdir:-/var/db/${name}} # directory to run in > > # untested >@@ -58,8 +59,8 @@ > > _rc=0 > for _entry; do >- # do nothing if /var/run or /var/db >- echo ${_entry} | egrep -q '^//*(var//*(run|db)/*)?$' || _rc=1 >+ # do nothing if /dev, /var/run or /var/db >+ echo ${_entry} | egrep -q '^//*(dev|var//*(run|db))?/*$' || _rc=1 > done > debug precious: "$@" rc=${_rc} > return ${_rc} >@@ -139,7 +140,7 @@ > safe_run ${_rc} safe_rmdir ${_dir%/*} || _rc=1 > else > warn "unable to remove directory ${_dir}" >- rc=1 >+ _rc=1 > fi > fi > done >@@ -162,16 +163,24 @@ > return ${_rc} > } > >-safe_remove () # file... >+safe_remove () # entry... > { >- local _file _rc >+ local _entry _rc > > _rc=0 >- for _file; do >- if [ -f ${_file} ] && >- ! safe_run ${_rc} rm -f ${_file}; then >- warn "unable to remove file ${_file}" >- _rc=1 >+ for _entry; do >+ if [ -f ${_entry} ]; then >+ if ! safe_run ${_rc} rm -f ${_entry}; then >+ warn "unable to remove file ${_entry}" >+ _rc=1 >+ fi >+ elif [ -d ${_entry} ] && >+ ! precious ${_entry} && >+ ! mounted ${_entry}; then >+ if ! safe_run ${_rc} rm -rf ${_entry}; then >+ warn "unable to remove directory ${_entry}" >+ _rc=1 >+ fi > fi > done > return ${_rc} >@@ -184,12 +193,26 @@ > _src=$1 _dst=$2 > > _rc=0 >- if ! safe_run ${_rc} safe_remove ${_dst} || >- ! safe_run ${_rc} cp -p ${_src} ${_dst}; then >- err 1 "unable to copy file ${_src} to ${_dst}" >+ if [ -f ${_src} ]; then >+ if ! safe_run ${_rc} safe_remove ${_dst} || >+ ! safe_run ${_rc} cp -p ${_src} ${_dst}; then >+ err 1 "unable to copy file ${_src} to ${_dst}" >+ _rc=1 >+ fi >+ safe_run ${_rc} safe_chmog ${_dst} || _rc=1 >+ elif [ -d ${_src} ] && >+ ! precious ${_dst} && >+ ! mounted ${_dst}; then >+ if ! safe_run ${_rc} pax -rw -pe -ts "|^${_src}||" \ >+ ${_src} ${_dst}; then >+ err 1 "unable to copy directory ${_src} to ${_dst}" >+ _rc=1 >+ fi >+ else >+ err 1 "unable to copy ${_src} to ${_dst}" \ >+ "-- not a file or a directory" > _rc=1 > fi >- safe_run ${_rc} safe_chmog ${_dst} || _rc=1 > return ${_rc} > } > >@@ -198,10 +221,12 @@ > local _rc > > _rc=1 >- mount -t devfs | awk ' >- BEGIN { n = ARGC; ARGC = 2 } >- { for (i = 2; i != n; i++) if ($3 == ARGV[i]) exit 1 } >- ' - "$@" || _rc=0 >+ if checkyesno dhcpd_devfs_enable; then >+ mount -t devfs | awk ' >+ BEGIN { n = ARGC; ARGC = 2 } >+ { for (i = 2; i != n; i++) if ($3 == ARGV[i]) exit 1 } >+ ' - "$@" || _rc=0 >+ fi > debug mounted: "$@" rc=${_rc} > return ${_rc} > } >@@ -213,7 +238,8 @@ > _dir=$1 > > _rc=0 >- if ! mounted ${_dir} && >+ if checkyesno dhcpd_devfs_enable && >+ ! mounted ${_dir} && > ! safe_run ${_rc} mount -t devfs devfs ${_dir}; then > err 1 "unable to mount ${_dir}" > _rc=1 >@@ -228,7 +254,8 @@ > _dir=$1 > > _rc=0 >- if mounted ${_dir} && >+ if checkyesno dhcpd_devfs_enable && >+ mounted ${_dir} && > ! safe_run ${_rc} umount ${_dir}; then > warn "unable to unmount ${_dir}" > _rc=1 >@@ -311,16 +338,25 @@ > check_chroot () > { > if checkyesno paranoia; then >- if checkyesno dhcpd_chroot_enable && >- [ -z "${dhcpd_rootdir}" ]; then >- err 1 "dhcpd_rootdir" \ >- "must be set if dhcpd_chroot_enable is enabled" >+ if checkyesno dhcpd_chroot_enable; then >+ if [ -z "${dhcpd_rootdir}" ]; then >+ err 1 "dhcpd_rootdir must be set" \ >+ "if dhcpd_chroot_enable is enabled" >+ fi >+ if ! ( type mount_devfs ) > /dev/null 2>&1; then >+ warn "dhcpd_devfs_enable disabled" \ >+ "-- not available" >+ dhcpd_devfs_enable=NO >+ fi >+ else >+ dhcpd_devfs_enable=NO > fi > else > if checkyesno dhcpd_chroot_enable; then > warn "dhcpd_chroot_enable disabled -- not compiled in" > dhcpd_chroot_enable=NO > fi >+ dhcpd_devfs_enable=NO > fi > } > >@@ -346,6 +382,8 @@ > { > if ! checkyesno paranoia || ! checkyesno dhcpd_chroot_enable; then > dhcpd_rootdir= >+ elif checkyesno paranoia && checkyesno dhcpd_chroot_enable; then >+ dhcpd_devdir=${__dhcpd_devdir} > fi > } > >@@ -364,7 +402,7 @@ > rcvar_rooted () > { > _dhcpd_rootdir=${dhcpd_rootdir} >- _dhcpd_devdir=${dhcpd_rootdir}/dev >+ _dhcpd_devdir=${dhcpd_rootdir}${dhcpd_devdir} > _dhcpd_confdir=${dhcpd_rootdir}${dhcpd_confdir} > _dhcpd_piddir=${dhcpd_rootdir}${dhcpd_piddir} > _dhcpd_leasesdir=${dhcpd_rootdir}${dhcpd_leasesdir} >@@ -404,8 +442,13 @@ > setup_chroot () > { > if checkyesno paranoia && checkyesno dhcpd_chroot_enable; then >- safe_mkdir ${_dhcpd_rootdir} ${_dhcpd_devdir} ${_dhcpd_confdir} >- safe_mount ${_dhcpd_devdir} >+ safe_mkdir ${_dhcpd_rootdir} ${_dhcpd_devdir}/_ ${_dhcpd_confdir} >+ safe_rmdir ${_dhcpd_devdir}/_ # /_, so, .../dev is root owned. >+ if checkyesno dhcpd_devfs_enable; then >+ safe_mount ${_dhcpd_devdir} >+ else >+ safe_copy ${dhcpd_devdir} ${_dhcpd_devdir} >+ fi > safe_copy ${dhcpd_conffile} ${_dhcpd_conffile} > fi > } >@@ -495,8 +538,13 @@ > { > if checkyesno paranoia && checkyesno dhcpd_chroot_enable; then > safe_remove ${_dhcpd_conffile} >- safe_umount ${_dhcpd_devdir} >- safe_rmdir ${_dhcpd_confdir} ${_dhcpd_devdir} ${_dhcpd_rootdir} >+ if checkyesno dhcpd_devfs_enable; then >+ safe_umount ${_dhcpd_devdir} >+ safe_rmdir ${_dhcpd_devdir} >+ else >+ safe_remove ${_dhcpd_devdir} >+ fi >+ safe_rmdir ${_dhcpd_confdir} ${_dhcpd_rootdir} > fi > } > >@@ -601,6 +649,7 @@ > load_rc_config ${name} > > __dhcpd_uninstall="NO" # internal use only >+__dhcpd_devdir=/dev # devices directory > __dhcpd_piddir=/var/run # pid file directory > __dhcpd_leasesdir=/var/db # leases file directory > #__dhcpd_rootdir=/var/db/${name} # root directory >diff -ruN -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ /tmp/ports/net/isc-dhcp3-server/pkg-message /usr/ports/net/isc-dhcp3-server/pkg-message >--- pkg-message.orig Tue Sep 14 17:27:45 2004 >+++ pkg-message Tue Sep 14 16:38:15 2004 >@@ -17,6 +17,7 @@ > dhcpd_withuser="dhcpd" # user name to run as > dhcpd_withgroup="dhcpd" # group name to run as > dhcpd_chroot_enable="YES" # runs chrooted? >+ dhcpd_devfs_enable="YES" # uses devfs if available? > dhcpd_rootdir="/var/db/dhcpd" # directory to run in > dhcpd_flags="-early_chroot" # needs full root
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 71732
: 46783