Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 789149 Details for
Bug 848708
net-dns/bind-9.16.48 installs shell script that uses non-POSIX features
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
gentoo-bug-848708-r1.patch
gentoo-bug-848708-r1.patch (text/plain), 5.98 KB, created by
kfm
on 2022-07-01 08:07:57 UTC
(
hide
)
Description:
gentoo-bug-848708-r1.patch
Filename:
MIME Type:
Creator:
kfm
Created:
2022-07-01 08:07:57 UTC
Size:
5.98 KB
patch
obsolete
>diff --git a/net-dns/bind/files/named.init-r14 b/net-dns/bind/files/named.init-r14 >index ff6ab216a..0e2ce9b39 100644 >--- a/net-dns/bind/files/named.init-r14 >+++ b/net-dns/bind/files/named.init-r14 >@@ -16,56 +16,26 @@ NAMED_CONF=${CHROOT}/etc/bind/named.conf > OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0} > MOUNT_CHECK_TIMEOUT=${MOUNT_CHECK_TIMEOUT:-60} > >-_mount() { >- local from >- local to >- local opts >- local ret=0 >- >- if [ "${#}" -lt 3 ]; then >- eerror "_mount(): to few arguments" >- return 1 >- fi >- >- from=$1 >- to=$2 >- shift 2 >- >- opts="${*}" >- shift $# >- >- if [ -z "$(awk "\$2 == \"${to}\" { print \$2 }" /proc/mounts)" ]; then >- einfo "mounting ${from} to ${to}" >- mount ${from} ${to} ${opts} >- ret=$? >- >- eend $ret >- return $ret >+_bindmount() { >+ if ! mountpoint -q -- "$2"; then >+ ebegin "mounting $1 to $2" >+ mount -o bind -- "$1" "$2" >+ eend $? > fi >- >- return 0 > } > > _umount() { >- local dir=$1 >- local ret=0 >- >- if [ -n "$(awk "\$2 == \"${dir}\" { print \$2 }" /proc/mounts)" ]; then >- ebegin "umounting ${dir}" >- umount ${dir} >- ret=$? >- >- eend $ret >- return $ret >+ if mountpoint -q -- "$1"; then >+ ebegin "umounting $1" >+ umount -- "$1" >+ eend $? > fi >- >- return 0 > } > > _get_pidfile() { > # as suggested in bug #107724, bug 335398#c17 > [ -n "${PIDFILE}" ] || PIDFILE=${CHROOT}$(\ >- /usr/sbin/named-checkconf -p ${CHROOT:+-t} ${CHROOT} ${NAMED_CONF#${CHROOT}} | grep 'pid-file' | cut -d\" -f2) >+ /usr/sbin/named-checkconf -p ${CHROOT:+-t} "${CHROOT}" "${NAMED_CONF#${CHROOT}}" | grep 'pid-file' | cut -d\" -f2) > [ -z "${PIDFILE}" ] && PIDFILE=${CHROOT}/run/named/named.pid > } > >@@ -79,7 +49,7 @@ check_chroot() { > [ ! -c "${CHROOT}/dev/null" ] || [ ! -c "${CHROOT}/dev/zero" ] && return 1 > [ ! -c "${CHROOT}/dev/urandom" ] && return 1 > [ "${CHROOT_GEOIP:-0}" -eq 1 ] && [ ! -d "${CHROOT}/usr/share/GeoIP" ] && return 1 >- if [ ${OPENSSL_LIBGOST:-0} -eq 1 ]; then >+ if [ "${OPENSSL_LIBGOST:-0}" -eq 1 ]; then > if [ -d "/usr/lib64" ]; then > [ ! -d "${CHROOT}/usr/lib64/engines" ] && return 1 > elif [ -d "/usr/lib" ]; then >@@ -99,7 +69,7 @@ checkconfig() { > return 1 > fi > >- /usr/sbin/named-checkconf ${CHROOT:+-t} ${CHROOT} ${NAMED_CONF#${CHROOT}} || { >+ /usr/sbin/named-checkconf ${CHROOT:+-t} "${CHROOT}" "${NAMED_CONF#${CHROOT}}" || { > eerror "named-checkconf failed! Please fix your config first." > return 1 > } >@@ -110,7 +80,7 @@ checkconfig() { > > checkzones() { > ebegin "Checking named configuration and zones" >- /usr/sbin/named-checkconf -z -j ${CHROOT:+-t} ${CHROOT} ${NAMED_CONF#${CHROOT}} >+ /usr/sbin/named-checkconf -z -j ${CHROOT:+-t} "${CHROOT}" "${NAMED_CONF#${CHROOT}}" > eend $? > } > >@@ -120,7 +90,7 @@ start() { > ebegin "Starting ${CHROOT:+chrooted }named" > > if [ -n "${CHROOT}" ]; then >- if [ ${CHROOT_NOCHECK:-0} -eq 0 ]; then >+ if [ "${CHROOT_NOCHECK:-0}" -eq 0 ]; then > check_chroot || { > eend 1 > eerror "Your chroot dir ${CHROOT} is inconsistent, please run 'emerge --config net-dns/bind' first" >@@ -128,7 +98,7 @@ start() { > } > fi > >- if [ ${OPENSSL_LIBGOST:-0} -eq 1 ]; then >+ if [ "${OPENSSL_LIBGOST:-0}" -eq 1 ]; then > if [ ! -e /usr/lib/engines/libgost.so ]; then > eend 1 > eerror "Couldn't find /usr/lib/engines/libgost.so but bind has been built with openssl and libgost support" >@@ -144,11 +114,11 @@ start() { > > if [ "${CHROOT_NOMOUNT:-0}" -eq 0 ]; then > einfo "Mounting chroot dirs" >- _mount /etc/bind ${CHROOT}/etc/bind -o bind >- _mount /var/bind ${CHROOT}/var/bind -o bind >- _mount /var/log/named ${CHROOT}/var/log/named -o bind >+ _bindmount /etc/bind "${CHROOT}/etc/bind" >+ _bindmount /var/bind "${CHROOT}/var/bind" >+ _bindmount /var/log/named "${CHROOT}/var/log/named" > if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then >- _mount /usr/share/GeoIP ${CHROOT}/usr/share/GeoIP -o bind >+ _bindmount /usr/share/GeoIP "${CHROOT}/usr/share/GeoIP" > fi > fi > >@@ -173,22 +143,23 @@ start() { > CPU="-n ${CPU}" > fi > >- start-stop-daemon --start --pidfile ${PIDFILE} \ >- --nicelevel ${NAMED_NICELEVEL:-0} \ >+ start-stop-daemon --start --pidfile "${PIDFILE}" \ >+ --nicelevel "${NAMED_NICELEVEL:-0}" \ > --exec /usr/sbin/named \ > -- -u named ${CPU} ${OPTIONS} ${CHROOT:+-t} ${CHROOT} > eend $? > } > > stop() { >- local reported=0 >+ local reported >+ reported=0 > > ebegin "Stopping ${CHROOT:+chrooted }named" > > # Workaround for now, until openrc's restart has been fixed. > # openrc doesn't care about a restart() function in init scripts. > if [ "${RC_CMD}" = "restart" ]; then >- if [ -n "${CHROOT}" -a ${CHROOT_NOCHECK:-0} -eq 0 ]; then >+ if [ -n "${CHROOT}" ] && [ "${CHROOT_NOCHECK:-0}" -eq 0 ]; then > check_chroot || { > eend 1 > eerror "Your chroot dir ${CHROOT} is inconsistent, please run 'emerge --config net-dns/bind' first" >@@ -201,14 +172,14 @@ stop() { > > # -R 10, bug 335398 > _get_pidfile >- start-stop-daemon --stop --retry 10 --pidfile $PIDFILE \ >+ start-stop-daemon --stop --retry 10 --pidfile "${PIDFILE}" \ > --exec /usr/sbin/named > > if [ -n "${CHROOT}" ] && [ "${CHROOT_NOMOUNT:-0}" -eq 0 ]; then > ebegin "Umounting chroot dirs" > > # just to be sure everything gets clean >- while fuser -s ${CHROOT} 2>/dev/null; do >+ while fuser -s "${CHROOT}" 2>/dev/null; do > if [ "${reported}" -eq 0 ]; then > einfo "Waiting until all named processes are stopped (max. ${MOUNT_CHECK_TIMEOUT} seconds)" > elif [ "${reported}" -eq "${MOUNT_CHECK_TIMEOUT}" ]; then >@@ -220,10 +191,10 @@ stop() { > reported=$((reported+1)) > done > >- [ "${CHROOT_GEOIP:-0}" -eq 1 ] && _umount ${CHROOT}/usr/share/GeoIP >- _umount ${CHROOT}/etc/bind >- _umount ${CHROOT}/var/log/named >- _umount ${CHROOT}/var/bind >+ [ "${CHROOT_GEOIP:-0}" -eq 1 ] && _umount "${CHROOT}/usr/share/GeoIP" >+ _umount "${CHROOT}/etc/bind" >+ _umount "${CHROOT}/var/log/named" >+ _umount "${CHROOT}/var/bind" > fi > > eend $? >@@ -238,7 +209,7 @@ reload() { > > _get_pidfile > if [ -n "${PIDFILE}" ]; then >- start-stop-daemon --pidfile $PIDFILE --signal HUP >+ start-stop-daemon --pidfile "${PIDFILE}" --signal HUP > ret=$? > else > ewarn "Unable to determine the pidfile... this is"
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 848708
:
781553
|
789110
|
789149
|
789152