|
|
|
@ -1182,7 +1182,9 @@ netpgp_save_ring(netpgp_t *netpgp,
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ensure temporary file isn't already existing */
|
|
|
|
|
unlink(swpfile);
|
|
|
|
|
|
|
|
|
|
if ((fd = pgp_setup_file_write(&output, swpfile, 0)) < 0) {
|
|
|
|
|
(void) fprintf(io->errs,
|
|
|
|
|
"netpgp_save_%s : can't setup write for %s\n", name, swpfile);
|
|
|
|
@ -1209,7 +1211,12 @@ netpgp_save_ring(netpgp_t *netpgp,
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rename(ringfile, backup);
|
|
|
|
|
/* save ring if "backup rings" variable is set */
|
|
|
|
|
if (netpgp_getvar(netpgp, "backup rings") != NULL) {
|
|
|
|
|
rename(ringfile, backup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* replace ring file with swap file */
|
|
|
|
|
rename(swpfile, ringfile);
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|