summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ssh-agent.c15
2 files changed, 13 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 46729e70a..8345586e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,10 @@
16 These options have been in use for some years; 16 These options have been in use for some years;
17 ok markus@ "no objection" millert@ 17 ok markus@ "no objection" millert@
18 (NB. RCD ID sync only for portable) 18 (NB. RCD ID sync only for portable)
19 - canacar@cvs.openbsd.org 2007/09/25 23:48:57
20 [ssh-agent.c]
21 When adding a key that already exists, update the properties
22 (time, confirm, comment) instead of discarding them. ok djm@ markus@
19 23
2020070927 2420070927
21 - (dtucker) [configure.ac atomicio.c] Fall back to including <sys/poll.h> if 25 - (dtucker) [configure.ac atomicio.c] Fall back to including <sys/poll.h> if
@@ -3287,4 +3291,4 @@
3287 OpenServer 6 and add osr5bigcrypt support so when someone migrates 3291 OpenServer 6 and add osr5bigcrypt support so when someone migrates
3288 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 3292 passwords between UnixWare and OpenServer they will still work. OK dtucker@
3289 3293
3290$Id: ChangeLog,v 1.4763 2007/10/26 04:25:12 djm Exp $ 3294$Id: ChangeLog,v 1.4764 2007/10/26 04:25:31 djm Exp $
diff --git a/ssh-agent.c b/ssh-agent.c
index fb12545b0..f17948349 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.156 2007/09/09 11:38:01 sobrado Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.157 2007/09/25 23:48:57 canacar Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -457,6 +457,7 @@ static void
457process_add_identity(SocketEntry *e, int version) 457process_add_identity(SocketEntry *e, int version)
458{ 458{
459 Idtab *tab = idtab_lookup(version); 459 Idtab *tab = idtab_lookup(version);
460 Identity *id;
460 int type, success = 0, death = 0, confirm = 0; 461 int type, success = 0, death = 0, confirm = 0;
461 char *type_name, *comment; 462 char *type_name, *comment;
462 Key *k = NULL; 463 Key *k = NULL;
@@ -539,19 +540,19 @@ process_add_identity(SocketEntry *e, int version)
539 } 540 }
540 if (lifetime && !death) 541 if (lifetime && !death)
541 death = time(NULL) + lifetime; 542 death = time(NULL) + lifetime;
542 if (lookup_identity(k, version) == NULL) { 543 if ((id = lookup_identity(k, version)) == NULL) {
543 Identity *id = xmalloc(sizeof(Identity)); 544 id = xmalloc(sizeof(Identity));
544 id->key = k; 545 id->key = k;
545 id->comment = comment;
546 id->death = death;
547 id->confirm = confirm;
548 TAILQ_INSERT_TAIL(&tab->idlist, id, next); 546 TAILQ_INSERT_TAIL(&tab->idlist, id, next);
549 /* Increment the number of identities. */ 547 /* Increment the number of identities. */
550 tab->nentries++; 548 tab->nentries++;
551 } else { 549 } else {
552 key_free(k); 550 key_free(k);
553 xfree(comment); 551 xfree(id->comment);
554 } 552 }
553 id->comment = comment;
554 id->death = death;
555 id->confirm = confirm;
555send: 556send:
556 buffer_put_int(&e->output, 1); 557 buffer_put_int(&e->output, 1);
557 buffer_put_char(&e->output, 558 buffer_put_char(&e->output,