diff --git a/CHANGES b/CHANGES index 81467fe920..dcdd2ea7f2 100644 --- 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 diff --git a/bin/dnssec/dnssec-dsfromkey.c b/bin/dnssec/dnssec-dsfromkey.c index 8e3e2daef2..c29949bfe6 100644 --- a/bin/dnssec/dnssec-dsfromkey.c +++ b/bin/dnssec/dnssec-dsfromkey.c @@ -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); } diff --git a/lib/dns/dst_parse.c b/lib/dns/dst_parse.c index 43ac9f33eb..bd7aac592a 100644 --- a/lib/dns/dst_parse.c +++ b/lib/dns/dst_parse.c @@ -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 @@ -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 */