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 /ssh-add.c | |
parent | 11d470de348beb5e9f6a2dcc27fdeb1ad8257acd (diff) |
- 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@
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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(); |