]> 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 02:56:13 +0000 (02:56 +0000)
committerMark Andrews <marka@isc.org>
Mon, 2 Mar 2009 02:56:13 +0000 (02:56 +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 32d8008060eda48ccb6fd64fcb1fedc783f4f048..95e40f643c9a393c6917858e7bd60f3be7b6c868 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]
 
 2564.  [bug]           Only take EDNS fallback steps when processing timeouts.
index cb0288a3401abfcc4a2d81d0e449e81978977c5e..653aa3ea7a5a021bec19b5fbef39360099efdff1 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-dsfromkey.c,v 1.2.14.2 2009/02/17 23:47:15 tbox Exp $ */
+/* $Id: dnssec-dsfromkey.c,v 1.2.14.3 2009/03/02 02:54:15 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..ccd408c567306090dd6b4cc852947248c94cb00f 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.14.120.1 2009/03/02 02:54:15 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 */