upstream commit

regression: incorrect error message on
 otherwise-successful ssh-keygen -A. Reported by Dmitry Orlov, via deraadt@
This commit is contained in:
djm@openbsd.org 2015-01-16 15:55:07 +00:00 committed by Damien Miller
parent 9010902954
commit bb8b442d32
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keygen.c,v 1.253 2015/01/16 06:40:12 deraadt Exp $ */
/* $OpenBSD: ssh-keygen.c,v 1.254 2015/01/16 15:55:07 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -1009,8 +1009,8 @@ do_gen_all_hostkeys(struct passwd *pw)
first = 0;
continue;
}
if (!sshkey_write(public, f)) {
fprintf(stderr, "write key failed\n");
if ((r = sshkey_write(public, f)) != 0) {
fprintf(stderr, "write key failed: %s\n", ssh_err(r));
fclose(f);
sshkey_free(public);
first = 0;