]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2566. [bug] dst__privstruct_writefile() could miss write errors.
authorMark Andrews <marka@isc.org>
Mon, 2 Mar 2009 02:00:34 +0000 (02:00 +0000)
committerMark Andrews <marka@isc.org>
Mon, 2 Mar 2009 02:00:34 +0000 (02:00 +0000)
                        [RT #19360]

CHANGES
lib/dns/dst_api.c

diff --git a/CHANGES b/CHANGES
index 0178e55855183cb8159a660e76973e4aac9a749f..f9e7936d01c21b286fcbc99e5347d837795b57d6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2566.  [bug]           dst__privstruct_writefile() could miss write errors.
+                       [RT #19360]
+
 2564.  [bug]           Only take EDNS fallback steps when processing timeouts.
                        [RT #19405]
 
index ce2fbd11c0857ececc9152f4fb7f01f92a903312..144c685e10897f9c358c2b14fc4cda02cc725cd2 100644 (file)
@@ -31,7 +31,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: dst_api.c,v 1.16.12.2 2009/02/16 23:47:15 tbox Exp $
+ * $Id: dst_api.c,v 1.16.12.3 2009/03/02 02:00:34 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