]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2977. [bug] 'nsupdate -l' report if the session key is missing.
authorMark Andrews <marka@isc.org>
Fri, 3 Dec 2010 00:39:46 +0000 (00:39 +0000)
committerMark Andrews <marka@isc.org>
Fri, 3 Dec 2010 00:39:46 +0000 (00:39 +0000)
                        [RT #21670]

CHANGES
bin/nsupdate/nsupdate.c
bin/tests/system/nsupdate/clean.sh
bin/tests/system/nsupdate/tests.sh

diff --git a/CHANGES b/CHANGES
index e3010bec534c41c9e017210059c1329d451ffdbd..cbf3b5fa977233e4e447378bb6cf0baa9b098a8d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2977.  [bug]           'nsupdate -l' report if the session key is missing.
+                       [RT #21670]
+
 2976.  [bug]           named could die on exit after negotiating a GSS-TSIG
                        key. [RT #22573]
                        
index 4d268a2bb25000d74ce7f6d64d286cf0b446dad5..6fbadaf2c8c8a965f44bcd10af016878962111dd 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsupdate.c,v 1.173.66.9 2010/12/02 23:26:56 marka Exp $ */
+/* $Id: nsupdate.c,v 1.173.66.10 2010/12/03 00:39:46 marka Exp $ */
 
 /*! \file */
 
@@ -901,9 +901,12 @@ setup_system(void) {
 
        if (keystr != NULL)
                setup_keystr();
-       else if (local_only)
-               read_sessionkey(mctx, lctx);
-       else if (keyfile != NULL)
+       else if (local_only) {
+               result = read_sessionkey(mctx, lctx);
+               if (result != ISC_R_SUCCESS)
+                       fatal("can't read key from %s: %s\n",
+                             keyfile, isc_result_totext(result));
+       } else if (keyfile != NULL)
                setup_keyfile(mctx, lctx);
 }
 
index e1083f270ee2c17476d883e4040984ad5ae5ae52..2677aab3ee77b9885e448247063c89a36339805f 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: clean.sh,v 1.16.34.2 2010/11/30 23:46:15 tbox Exp $
+# $Id: clean.sh,v 1.16.34.3 2010/12/03 00:39:46 marka Exp $
 
 #
 # Clean up after zone transfer tests.
@@ -28,3 +28,4 @@ rm -f random.data
 rm -f ns2/example.bk
 rm -f ns2/update.bk
 rm -f */named.memstats
+rm -f nsupdate.out
index fe041ee68308c791deb44cfd65ffb0531699c34d..7f1497eec74f120c1c2b0704934d508025993062 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.28.102.2 2010/11/30 23:46:15 tbox Exp $
+# $Id: tests.sh,v 1.28.102.3 2010/12/03 00:39:46 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -239,5 +239,14 @@ $DIG +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd updated4.example.nil.\
        @10.53.0.1 a -p 5300 > dig.out.ns1 || status=1
 $PERL ../digcomp.pl knowngood.ns1.afterstop dig.out.ns1 || status=1
 
+ret=0
+echo "I:check that 'nsupdate -l' with a missing keyfile reports the missing file"
+$NSUPDATE -l -p 5300 -k ns1/nonexistant.key 2> nsupdate.out < /dev/null
+grep ns1/nonexistant.key nsupdate.out > /dev/null || ret=1
+if test $ret -ne 0
+then
+echo "I:failed"; status=1
+fi
+
 echo "I:exit status: $status"
 exit $status