[BACK]Return to ssh-add.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/ssh-add.c between version 1.41 and 1.42

version 1.41, 2001/06/25 08:25:40 version 1.42, 2001/06/26 04:59:59
Line 144 
Line 144 
 }  }
   
 static void  static void
   update_card(AuthenticationConnection *ac, int add, int id)
   {
           if (ssh_update_card(ac, add, id))
                   fprintf(stderr, "Card %s: %d\n",
                        add ? "added" : "removed", id);
           else
                   fprintf(stderr, "Could not %s card: %d\n",
                        add ? "add" : "remove", id);
   }
   
   static void
 list_identities(AuthenticationConnection *ac, int do_fp)  list_identities(AuthenticationConnection *ac, int do_fp)
 {  {
         Key *key;          Key *key;
Line 175 
Line 186 
                 printf("The agent has no identities.\n");                  printf("The agent has no identities.\n");
 }  }
   
   static void
   usage(void)
   {
           printf("Usage: ssh-add [options]\n");
           printf("    -l, -L        : list identities\n");
           printf("    -d            : delete identity\n");
           printf("    -D            : delete all identities\n");
           printf("    -s reader_num : add key in the smartcard in reader_num.\n");
           printf("    -e reader_num : remove key in the smartcard in reader_num.\n");
           exit (1);
   }
   
 int  int
 main(int argc, char **argv)  main(int argc, char **argv)
 {  {
Line 184 
Line 207 
         int no_files = 1;          int no_files = 1;
         int i;          int i;
         int deleting = 0;          int deleting = 0;
           int sc_mode = 0;
           int sc_reader_num = 0;
   
         SSLeay_add_all_algorithms();          SSLeay_add_all_algorithms();
   
Line 210 
Line 235 
                         no_files = 0;                          no_files = 0;
                         continue;                          continue;
                 }                  }
                   if (strcmp(argv[i], "-s") == 0) {
                           sc_mode = 1;
                           deleting = 0;
                           i++;
                           if (i >= argc)
                                   usage();
                           sc_reader_num = atoi(argv[i]);
                           continue;
                   }
                   if (strcmp(argv[i], "-e") == 0) {
                           sc_mode = 1;
                           deleting = 1;
                           i++;
                           if (i >= argc)
                                   usage();
                           sc_reader_num = atoi(argv[i]);
                           continue;
                   }
                   if (sc_mode == 1)
                           update_card(ac, !deleting, sc_reader_num);
                 no_files = 0;                  no_files = 0;
                 if (deleting)                  if (deleting)
                         delete_file(ac, argv[i]);                          delete_file(ac, argv[i]);
                 else                  else
                         add_file(ac, argv[i]);                          add_file(ac, argv[i]);
           }
           if (sc_mode == 1) {
                   update_card(ac, !deleting, sc_reader_num);
                   ssh_close_authentication_connection(ac);
                   exit(0);
         }          }
         if (no_files) {          if (no_files) {
                 pw = getpwuid(getuid());                  pw = getpwuid(getuid());

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42