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

Diff for /src/usr.bin/encrypt/encrypt.c between version 1.17 and 1.18

version 1.17, 2003/04/06 21:22:31 version 1.18, 2003/06/14 23:19:18
Line 54 
Line 54 
 {  {
   
         (void)fprintf(stderr,          (void)fprintf(stderr,
             "usage: %s [-k] [-b rounds] [-m] [-s salt] [-p | string]\n",              "usage: %s [-k] [-b rounds] [-c class] [-m] [-s salt] [-p | string]\n",
             __progname);              __progname);
         exit(1);          exit(1);
 }  }
Line 117 
Line 117 
   
         default:          default:
                 pwd.pw_name = "default";                  pwd.pw_name = "default";
                 if ((lc = login_getclass(NULL)) == NULL)                  if ((lc = login_getclass(extra)) == NULL)
                         errx(1, "unable to get default login class.");                          errx(1, "unable to get login class `%s'",
                               extra ? (char *)extra : "default");
                 if (!pwd_gensalt(buffer, _PASSWORD_LEN, &pwd, lc, 'l'))                  if (!pwd_gensalt(buffer, _PASSWORD_LEN, &pwd, lc, 'l'))
                         errx(1, "can't generate salt");                          errx(1, "can't generate salt");
                 salt = buffer;                  salt = buffer;
Line 135 
Line 136 
         int operation = -1;          int operation = -1;
         int prompt = 0;          int prompt = 0;
         int rounds;          int rounds;
         void *extra;                       /* Store salt or number of rounds */          void *extra = NULL;             /* Store salt or number of rounds */
   
         if (strcmp(__progname, "makekey") == 0)          if (strcmp(__progname, "makekey") == 0)
                 operation = DO_MAKEKEY;                  operation = DO_MAKEKEY;
   
         while ((opt = getopt(argc, argv, "kmps:b:")) != -1) {          while ((opt = getopt(argc, argv, "kmps:b:c:")) != -1) {
                 switch (opt) {                  switch (opt) {
                 case 'k':                       /* Stdin/Stdout Unix crypt */                  case 'k':                       /* Stdin/Stdout Unix crypt */
                         if (operation != -1 || prompt)                          if (operation != -1 || prompt)
Line 173 
Line 174 
                         operation = DO_BLF;                          operation = DO_BLF;
                         rounds = atoi(optarg);                          rounds = atoi(optarg);
                         extra = &rounds;                          extra = &rounds;
                           break;
   
                   case 'c':                       /* user login class */
                           extra = optarg;
                           operation = -1;
                         break;                          break;
   
                 default:                  default:

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18