}
}
+proc isolate {body} {
+ ## Evaluate BODY without changing the caller's variables. Return its
+ ## result.
+
+ eval $body
+}
+
###--------------------------------------------------------------------------
### Configuration spaces.
###
proc local-address-p {addr} {
## Answer whether the ADDR is one of the host's addresses.
+ global env
- if {[catch { set sk [socket -server {} -myaddr $addr 0] }]} {
- return false
+ if {[info exists env(ZONECONF_LOCAL_ADDRESSES)]} {
+ if {[string match "*:$addr:*" ":$env(ZONECONF_LOCAL_ADDRESSES):"]} {
+ return true
+ } else {
+ return false
+ }
} else {
- close $sk
- return true
+ if {[catch { set sk [socket -server {} -myaddr $addr 0] }]} {
+ return false
+ } else {
+ close $sk
+ return true
+ }
}
}
define-list sign-views {}
define-list signzone-command \
[list "$BINDPROGS/dnssec-signzone" \
- "-g" \
"-S" \
"-K%h/key" \
"-d%h/ds" \
} {
global ZONECFG CONFFILE
- confspc-eval toplevel [list source $CONFFILE]
+ isolate [list confspc-eval toplevel [list source $CONFFILE]]
foreach view $ZONECFG(all-views) { puts [output-file-name $view] }
}
global ZONECFG ZONES CONFFILE
## Read the configuration.
- confspc-eval toplevel [list source $CONFFILE]
+ isolate [list confspc-eval toplevel [list source $CONFFILE]]
## Safely update the files.
set win false
global QUIS ZONECFG ZONES CONFFILE errorInfo errorCode
## Read the configuration.
- confspc-eval toplevel [list source $CONFFILE]
+ isolate [list confspc-eval toplevel [list source $CONFFILE]]
## Make sure there's a temporary directory.
file mkdir [file join $ZONECFG(home-dir) "tmp"]
set rc 0
## Read the configuration.
- confspc-eval toplevel [list source $CONFFILE]
+ isolate [list confspc-eval toplevel [list source $CONFFILE]]
## Grind through all of the zones.
array unset seen