version 1.43, 2001/06/27 06:26:36 |
version 1.44, 2001/08/01 22:03:33 |
|
|
} |
} |
|
|
static void |
static void |
update_card(AuthenticationConnection *ac, int add, int id) |
update_card(AuthenticationConnection *ac, int add, const char *id) |
{ |
{ |
if (ssh_update_card(ac, add, id)) |
if (ssh_update_card(ac, add, id)) |
fprintf(stderr, "Card %s: %d\n", |
fprintf(stderr, "Card %s: %s\n", |
add ? "added" : "removed", id); |
add ? "added" : "removed", id); |
else |
else |
fprintf(stderr, "Could not %s card: %d\n", |
fprintf(stderr, "Could not %s card: %s\n", |
add ? "add" : "remove", id); |
add ? "add" : "remove", id); |
} |
} |
|
|
|
|
AuthenticationConnection *ac = NULL; |
AuthenticationConnection *ac = NULL; |
struct passwd *pw; |
struct passwd *pw; |
char buf[1024]; |
char buf[1024]; |
int i, ch, deleting = 0, sc_reader_num = -1; |
char *sc_reader_id = NULL; |
|
int i, ch, deleting = 0; |
|
|
SSLeay_add_all_algorithms(); |
SSLeay_add_all_algorithms(); |
|
|
|
|
goto done; |
goto done; |
break; |
break; |
case 's': |
case 's': |
sc_reader_num = atoi(optarg); |
sc_reader_id = optarg; |
break; |
break; |
case 'e': |
case 'e': |
deleting = 1; |
deleting = 1; |
sc_reader_num = atoi(optarg); |
sc_reader_id = optarg; |
break; |
break; |
default: |
default: |
usage(); |
usage(); |
|
|
} |
} |
argc -= optind; |
argc -= optind; |
argv += optind; |
argv += optind; |
if (sc_reader_num != -1) { |
if (sc_reader_id != NULL) { |
update_card(ac, !deleting, sc_reader_num); |
update_card(ac, !deleting, sc_reader_id); |
goto done; |
goto done; |
} |
} |
if (argc == 0) { |
if (argc == 0) { |