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

Diff for /src/usr.bin/passwd/Attic/pwd_gensalt.c between version 1.6 and 1.7

version 1.6, 1997/03/27 23:02:58 version 1.7, 1997/04/10 20:04:54
Line 1 
Line 1 
   /* $OpenBSD$ */
 /*  /*
  * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>   * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
  * All rights reserved.   * All rights reserved.
Line 29 
Line 30 
  */   */
   
 #include <sys/syslimits.h>  #include <sys/syslimits.h>
   #include <sys/types.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
 #include <err.h>  #include <err.h>
   #include <grp.h>
 #include <pwd.h>  #include <pwd.h>
 #include <util.h>  #include <util.h>
 #include <time.h>  #include <time.h>
Line 49 
Line 52 
         char   *bcrypt_gensalt __P((u_int8_t));          char   *bcrypt_gensalt __P((u_int8_t));
         char    option[LINE_MAX];          char    option[LINE_MAX];
         char   *next, *now;          char   *next, *now;
           char   *cipher;
         *salt = '\0';          *salt = '\0';
   
         switch (type) {          switch (type) {
         case 'y':          case 'y':
                 pw_getconf(option, LINE_MAX, pwd->pw_name, "ypcipher");                  cipher = "ypcipher";
                 break;                  break;
         case 'l':          case 'l':
         default:          default:
                 pw_getconf(option, LINE_MAX, pwd->pw_name, "localcipher");                  cipher = "localcipher";
                 break;                  break;
           }
   
           pw_getconf(option, LINE_MAX, pwd->pw_name, cipher);
   
           /* Try to find an entry for the group */
           if (*option == 0) {
                   struct group *grp;
                   char grpkey[LINE_MAX];
   
                   grp = getgrgid(pwd->pw_gid);
                   if (grp != NULL) {
                           snprintf(grpkey, LINE_MAX-1, ".%s", grp->gr_name);
                           grpkey[LINE_MAX-1] = 0;
                           pw_getconf(option, LINE_MAX, grpkey, cipher);
                   }
                   if (*option == 0)
                           pw_getconf(option, LINE_MAX, "default", cipher);
         }          }
   
         next = option;          next = option;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7