diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-06-11 15:51:54 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-06-11 15:51:54 +0000 |
commit | 1775c9c97af0559f7b6df766ce79d66a1e883379 (patch) | |
tree | b4edba4e1b14b37dd429237688f08b1309bc472d | |
parent | 11d470de348beb5e9f6a2dcc27fdeb1ad8257acd (diff) | |
download | openssh-git-1775c9c97af0559f7b6df766ce79d66a1e883379.tar.gz |
- stevesk@cvs.openbsd.org 2002/06/10 17:36:23
[ssh-add.1 ssh-add.c]
use convtime() to parse and validate key lifetime. can now
use '-t 2h' etc. ok markus@ provos@
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ssh-add.1 | 6 | ||||
-rw-r--r-- | ssh-add.c | 11 |
3 files changed, 17 insertions, 6 deletions
@@ -13,6 +13,10 @@ - stevesk@cvs.openbsd.org 2002/06/10 16:56:30 [ssh-keysign.8] merge in stuff from my man page; ok markus@ + - stevesk@cvs.openbsd.org 2002/06/10 17:36:23 + [ssh-add.1 ssh-add.c] + use convtime() to parse and validate key lifetime. can now + use '-t 2h' etc. ok markus@ provos@ 20020609 - (bal) OpenBSD CVS Sync @@ -878,4 +882,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2203 2002/06/11 15:50:13 mouring Exp $ +$Id: ChangeLog,v 1.2204 2002/06/11 15:51:54 mouring Exp $ @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-add.1,v 1.33 2002/06/05 21:55:44 markus Exp $ +.\" $OpenBSD: ssh-add.1,v 1.34 2002/06/10 17:36:22 stevesk Exp $ .\" .\" -*- nroff -*- .\" @@ -90,7 +90,9 @@ Lock the agent with a password. Unlock the agent. .It Fl t Ar life Set a maximum lifetime when adding identities to an agent. -The lifetime is specified in seconds. +The lifetime may be specified in seconds or in a time format +specified in +.Xr sshd 8 . .It Fl s Ar reader Add key in smartcard .Ar reader . @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.56 2002/06/05 21:55:44 markus Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.57 2002/06/10 17:36:23 stevesk Exp $"); #include <openssl/evp.h> @@ -48,6 +48,7 @@ RCSID("$OpenBSD: ssh-add.c,v 1.56 2002/06/05 21:55:44 markus Exp $"); #include "authfile.h" #include "pathnames.h" #include "readpass.h" +#include "misc.h" #ifdef HAVE___PROGNAME extern char *__progname; @@ -67,7 +68,7 @@ static char *default_files[] = { }; /* Default lifetime (0 == forever) */ -static u_int lifetime = 0; +static int lifetime = 0; /* we keep a cache of one passphrases */ static char *pass = NULL; @@ -352,7 +353,11 @@ main(int argc, char **argv) sc_reader_id = optarg; break; case 't': - lifetime = atoi(optarg); + if ((lifetime = convtime(optarg)) == -1) { + fprintf(stderr, "Invalid lifetime\n"); + ret = 1; + goto done; + } break; default: usage(); |