diff options
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: ssh-add.c,v 1.43 2001/06/27 06:26:36 markus Exp $"); | 38 | RCSID("$OpenBSD: ssh-add.c,v 1.44 2001/08/01 22:03:33 markus Exp $"); |
39 | 39 | ||
40 | #include <openssl/evp.h> | 40 | #include <openssl/evp.h> |
41 | 41 | ||
@@ -150,13 +150,13 @@ add_file(AuthenticationConnection *ac, const char *filename) | |||
150 | } | 150 | } |
151 | 151 | ||
152 | static void | 152 | static void |
153 | update_card(AuthenticationConnection *ac, int add, int id) | 153 | update_card(AuthenticationConnection *ac, int add, const char *id) |
154 | { | 154 | { |
155 | if (ssh_update_card(ac, add, id)) | 155 | if (ssh_update_card(ac, add, id)) |
156 | fprintf(stderr, "Card %s: %d\n", | 156 | fprintf(stderr, "Card %s: %s\n", |
157 | add ? "added" : "removed", id); | 157 | add ? "added" : "removed", id); |
158 | else | 158 | else |
159 | fprintf(stderr, "Could not %s card: %d\n", | 159 | fprintf(stderr, "Could not %s card: %s\n", |
160 | add ? "add" : "remove", id); | 160 | add ? "add" : "remove", id); |
161 | } | 161 | } |
162 | 162 | ||
@@ -211,7 +211,8 @@ main(int argc, char **argv) | |||
211 | AuthenticationConnection *ac = NULL; | 211 | AuthenticationConnection *ac = NULL; |
212 | struct passwd *pw; | 212 | struct passwd *pw; |
213 | char buf[1024]; | 213 | char buf[1024]; |
214 | int i, ch, deleting = 0, sc_reader_num = -1; | 214 | char *sc_reader_id = NULL; |
215 | int i, ch, deleting = 0; | ||
215 | 216 | ||
216 | __progname = get_progname(argv[0]); | 217 | __progname = get_progname(argv[0]); |
217 | init_rng(); | 218 | init_rng(); |
@@ -240,11 +241,11 @@ main(int argc, char **argv) | |||
240 | goto done; | 241 | goto done; |
241 | break; | 242 | break; |
242 | case 's': | 243 | case 's': |
243 | sc_reader_num = atoi(optarg); | 244 | sc_reader_id = optarg; |
244 | break; | 245 | break; |
245 | case 'e': | 246 | case 'e': |
246 | deleting = 1; | 247 | deleting = 1; |
247 | sc_reader_num = atoi(optarg); | 248 | sc_reader_id = optarg; |
248 | break; | 249 | break; |
249 | default: | 250 | default: |
250 | usage(); | 251 | usage(); |
@@ -254,8 +255,8 @@ main(int argc, char **argv) | |||
254 | } | 255 | } |
255 | argc -= optind; | 256 | argc -= optind; |
256 | argv += optind; | 257 | argv += optind; |
257 | if (sc_reader_num != -1) { | 258 | if (sc_reader_id != NULL) { |
258 | update_card(ac, !deleting, sc_reader_num); | 259 | update_card(ac, !deleting, sc_reader_id); |
259 | goto done; | 260 | goto done; |
260 | } | 261 | } |
261 | if (argc == 0) { | 262 | if (argc == 0) { |