2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-04 08:35:31 +00:00

2567. [bug] dst__privstruct_writefile() could miss write errors.

write_public_key() could miss write errors.
                        dnssec-dsfromkey could miss write errors.
                        [RT #19360]
This commit is contained in:
Mark Andrews
2009-03-02 03:01:04 +00:00
parent 1cac6c196f
commit 98b2be76fc
3 changed files with 13 additions and 4 deletions

View File

@@ -1,4 +1,6 @@
2567. [bug] dst__privstruct_writefile() could miss write errors. 2567. [bug] dst__privstruct_writefile() could miss write errors.
write_public_key() could miss write errors.
dnssec-dsfromkey could miss write errors.
[RT #19360] [RT #19360]
2566. [cleanup] Clarify logged message when an insecure DNSSEC 2566. [cleanup] Clarify logged message when an insecure DNSSEC

View File

@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE. * 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 */ /*! \file */
@@ -387,5 +387,10 @@ main(int argc, char **argv) {
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
isc_mem_destroy(&mctx); isc_mem_destroy(&mctx);
return (0); fflush(stdout);
if (ferror(stdout)) {
fprintf(stderr, "write error\n");
return (1);
} else
return (0);
} }

View File

@@ -31,7 +31,7 @@
/*% /*%
* Principal Author: Brian Wellington * 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 <config.h> #include <config.h>
@@ -525,8 +525,10 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
fprintf(fp, "\n"); fprintf(fp, "\n");
} }
fflush(fp);
iret = ferror(fp) ? DST_R_WRITEERROR : ISC_R_SUCCESS;
fclose(fp); fclose(fp);
return (ISC_R_SUCCESS); return (iret);
} }
/*! \file */ /*! \file */