]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2567. [bug] dst__privstruct_writefile() could miss write errors.
authorMark Andrews <marka@isc.org>
Mon, 2 Mar 2009 03:01:04 +0000 (03:01 +0000)
committerMark Andrews <marka@isc.org>
Mon, 2 Mar 2009 03:01:04 +0000 (03:01 +0000)
                        write_public_key() could miss write errors.
                        dnssec-dsfromkey could miss write errors.
                        [RT #19360]

CHANGES
bin/dnssec/dnssec-dsfromkey.c
lib/dns/dst_parse.c

diff --git a/CHANGES b/CHANGES
index 81467fe920f589cdaf32c8da2ff339e3a1ecb950..dcdd2ea7f288647008cd8399c7ceb789be95f41b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,6 @@
 2567.  [bug]           dst__privstruct_writefile() could miss write errors.
+                       write_public_key() could miss write errors.
+                       dnssec-dsfromkey could miss write errors.
                        [RT #19360]
 
 2566.  [cleanup]       Clarify logged message when an insecure DNSSEC
index 8e3e2daef20ca5efe469a6e4d9d7d2fb252bf21d..c29949bfe63426984275c2ba2b3ea8835b90b281 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-dsfromkey.c,v 1.4 2009/02/17 23:47:46 tbox Exp $ */
+/* $Id: dnssec-dsfromkey.c,v 1.5 2009/03/02 03:01:04 marka Exp $ */
 
 /*! \file */
 
@@ -387,5 +387,10 @@ main(int argc, char **argv) {
                isc_mem_stats(mctx, stdout);
        isc_mem_destroy(&mctx);
 
-       return (0);
+       fflush(stdout);
+       if (ferror(stdout)) {
+               fprintf(stderr, "write error\n");
+               return (1);
+       } else
+               return (0);
 }
index 43ac9f33eb19356fff7c3f03532e27c93abf5947..bd7aac592abe6acbe9559764f2ee5c4189f6321f 100644 (file)
@@ -31,7 +31,7 @@
 
 /*%
  * Principal Author: Brian Wellington
- * $Id: dst_parse.c,v 1.14 2008/03/31 23:47:11 tbox Exp $
+ * $Id: dst_parse.c,v 1.15 2009/03/02 03:01:04 marka Exp $
  */
 
 #include <config.h>
@@ -525,8 +525,10 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
                fprintf(fp, "\n");
        }
 
+       fflush(fp);
+       iret = ferror(fp) ? DST_R_WRITEERROR : ISC_R_SUCCESS;
        fclose(fp);
-       return (ISC_R_SUCCESS);
+       return (iret);
 }
 
 /*! \file */