# HG changeset patch # User Tero Marttila # Date 1332243824 -7200 # Node ID 3613e93e4fd70d02a1e5a1228d98744054280814 # Parent 3d6bf3864d8a0effab4ecf9aaeeab23a744422a7 update: rndc: fail if no read perms on $RNDC_KEY diff -r 3d6bf3864d8a -r 3613e93e4fd7 bin/update --- a/bin/update Tue Mar 20 13:40:33 2012 +0200 +++ b/bin/update Tue Mar 20 13:43:44 2012 +0200 @@ -35,6 +35,7 @@ NAMED_CHECKZONE=/usr/sbin/named-checkzone HG=/usr/bin/hg RNDC=/usr/sbin/rndc +RNDC_KEY=/etc/bind/rndc.key ### Command-line argument handling @@ -714,11 +715,16 @@ # # Invokes `rndc reload`, showing its output. function deploy_zones { + local msg="Reload zones" + if [ $DEPLOY_SKIP ]; then - log_skip "Reload zones: skipped" + log_skip "$msg: skipped" + + elif [ ! -r $RNDC_KEY ]; then + log_error " $msg: rndc: permission denied: $RNDC_KEY" else - log_update "Reload zones..." + log_update "$msg..." # run indent " rndc: " \ @@ -734,7 +740,7 @@ local repo=$REPO local commit_msg="$COMMIT_MSG" - local msg="Commit changes in $repo..." + local msg="Commit changes in $repo" # operate? if [ $COMMIT_FORCE ]; then