From: Mark Andrews Date: Mon, 2 Mar 2009 02:03:59 +0000 (+0000) Subject: 2567. [bug] dst__privstruct_writefile() could miss write errors. X-Git-Tag: v9.6.1b1~17^2~16 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=05c162292ff0db1cc65f6e5bd9052a65089ec5c3;p=thirdparty%2Fbind9.git 2567. [bug] dst__privstruct_writefile() could miss write errors. [RT #19360] --- diff --git a/CHANGES b/CHANGES index 552b9875181..81467fe920f 100644 --- 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 diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c index 2d973a99f79..06b5abdc46e 100644 --- a/lib/dns/dst_api.c +++ b/lib/dns/dst_api.c @@ -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