ssh-keygen.c (294464) | ssh-keygen.c (294496) |
---|---|
1/* $OpenBSD: ssh-keygen.c,v 1.276 2015/07/03 03:49:45 djm Exp $ */ | 1/* $OpenBSD: ssh-keygen.c,v 1.277 2015/08/19 23:17:51 djm Exp $ */ |
2/* 3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 5 * All rights reserved 6 * Identity and host key generation and maintenance. 7 * 8 * As far as I am concerned, the code I have written for this software 9 * can be used freely for any purpose. Any derived versions of this --- 1186 unchanged lines hidden (view full) --- 1196 if (inplace) { 1197 error("Not replacing existing known_hosts " 1198 "file because of errors"); 1199 unlink(tmp); 1200 } 1201 exit(1); 1202 } else if (delete_host && !ctx.found_key) { 1203 logit("Host %s not found in %s", name, identity_file); | 2/* 3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 5 * All rights reserved 6 * Identity and host key generation and maintenance. 7 * 8 * As far as I am concerned, the code I have written for this software 9 * can be used freely for any purpose. Any derived versions of this --- 1186 unchanged lines hidden (view full) --- 1196 if (inplace) { 1197 error("Not replacing existing known_hosts " 1198 "file because of errors"); 1199 unlink(tmp); 1200 } 1201 exit(1); 1202 } else if (delete_host && !ctx.found_key) { 1203 logit("Host %s not found in %s", name, identity_file); |
1204 unlink(tmp); | 1204 if (inplace) 1205 unlink(tmp); |
1205 } else if (inplace) { 1206 /* Backup existing file */ 1207 if (unlink(old) == -1 && errno != ENOENT) 1208 fatal("unlink %.100s: %s", old, strerror(errno)); 1209 if (link(identity_file, old) == -1) 1210 fatal("link %.100s to %.100s: %s", identity_file, old, 1211 strerror(errno)); 1212 /* Move new one into place */ --- 1475 unchanged lines hidden --- | 1206 } else if (inplace) { 1207 /* Backup existing file */ 1208 if (unlink(old) == -1 && errno != ENOENT) 1209 fatal("unlink %.100s: %s", old, strerror(errno)); 1210 if (link(identity_file, old) == -1) 1211 fatal("link %.100s to %.100s: %s", identity_file, old, 1212 strerror(errno)); 1213 /* Move new one into place */ --- 1475 unchanged lines hidden --- |