]> 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:03:59 +0000 (02:03 +0000)
committerMark Andrews <marka@isc.org>
Mon, 2 Mar 2009 02:03:59 +0000 (02:03 +0000)
                        [RT #19360]

CHANGES
lib/dns/dst_api.c

diff --git a/CHANGES b/CHANGES
index 552b98751816f3177f76539329343932081d2eb0..81467fe920f589cdaf32c8da2ff339e3a1ecb950 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2567.  [bug]           dst__privstruct_writefile() could miss write errors.
+                       [RT #19360]
+
 2566.  [cleanup]       Clarify logged message when an insecure DNSSEC
                        response arrives from a zone thought to be secure:
                        "insecurity proof failed" instead of "not
index 2d973a99f791dd6205f84670da6f9c75937d1b26..06b5abdc46e649ff867a8e7f250c5001019861e9 100644 (file)
@@ -31,7 +31,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.17 2008/12/01 03:51:47 marka Exp $
+ * $Id: dst_api.c,v 1.18 2009/03/02 02:03:59 marka Exp $
  */
 
 /*! \file */
@@ -1163,9 +1163,12 @@ write_public_key(const dst_key_t *key, int type, const char *directory) {
        fwrite(r.base, 1, r.length, fp);
 
        fputc('\n', fp);
+       fflush(fp);
+       if (ferror(fp))
+               ret = DST_R_WRITEERROR;
        fclose(fp);
 
-       return (ISC_R_SUCCESS);
+       return (ret);
 }
 
 static isc_result_t