[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.53 and 1.54

version 1.53, 2002/03/21 22:44:05 version 1.54, 2002/06/05 19:57:12
Line 223 
Line 223 
 }  }
   
 static int  static int
   lock_agent(AuthenticationConnection *ac, int lock)
   {
           char prompt[100], *p1, *p2;
           int passok = 1, ret = -1;
   
           strlcpy(prompt, "Enter lock password: ", sizeof(prompt));
           p1 = read_passphrase(prompt, RP_ALLOW_STDIN);
           if (lock) {
                   strlcpy(prompt, "Again: ", sizeof prompt);
                   p2 = read_passphrase(prompt, RP_ALLOW_STDIN);
                   if (strcmp(p1, p2) != 0) {
                           fprintf(stderr, "Passwords do not match.\n");
                           passok = 0;
                   }
                   memset(p2, 0, strlen(p2));
                   xfree(p2);
           }
           if (passok && ssh_lock_agent(ac, lock, p1)) {
                   fprintf(stderr, "Agent %slocked.\n", lock ? "" : "un");
                   ret = 0;
           } else
                   fprintf(stderr, "Failed to %slock agent.\n", lock ? "" : "un");
           memset(p1, 0, strlen(p1));
           xfree(p1);
           return -1;
   }
   
   static int
 do_file(AuthenticationConnection *ac, int deleting, char *file)  do_file(AuthenticationConnection *ac, int deleting, char *file)
 {  {
         if (deleting) {          if (deleting) {
Line 267 
Line 295 
                 fprintf(stderr, "Could not open a connection to your authentication agent.\n");                  fprintf(stderr, "Could not open a connection to your authentication agent.\n");
                 exit(2);                  exit(2);
         }          }
         while ((ch = getopt(argc, argv, "lLdDe:s:")) != -1) {          while ((ch = getopt(argc, argv, "lLdDxXe:s:")) != -1) {
                 switch (ch) {                  switch (ch) {
                 case 'l':                  case 'l':
                 case 'L':                  case 'L':
                         if (list_identities(ac, ch == 'l' ? 1 : 0) == -1)                          if (list_identities(ac, ch == 'l' ? 1 : 0) == -1)
                                   ret = 1;
                           goto done;
                           break;
                   case 'x':
                   case 'X':
                           if (lock_agent(ac, ch == 'x' ? 1 : 0) == -1)
                                 ret = 1;                                  ret = 1;
                         goto done;                          goto done;
                         break;                          break;

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54