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

Diff for /src/usr.bin/ssh/auth.c between version 1.153 and 1.154

version 1.153, 2021/07/05 00:50:25 version 1.154, 2022/02/23 11:17:10
Line 594 
Line 594 
 struct passwd *  struct passwd *
 fakepw(void)  fakepw(void)
 {  {
           static int done = 0;
         static struct passwd fake;          static struct passwd fake;
           const char hashchars[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZ"
               "abcdefghijklmnopqrstuvwxyz0123456789"; /* from bcrypt.c */
           char *cp;
   
           if (done)
                   return (&fake);
   
         memset(&fake, 0, sizeof(fake));          memset(&fake, 0, sizeof(fake));
         fake.pw_name = "NOUSER";          fake.pw_name = "NOUSER";
         fake.pw_passwd =          fake.pw_passwd = xstrdup("$2a$10$"
             "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK";              "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
           for (cp = fake.pw_passwd + 7; *cp != '\0'; cp++)
                   *cp = hashchars[arc4random_uniform(sizeof(hashchars) - 1)];
         fake.pw_gecos = "NOUSER";          fake.pw_gecos = "NOUSER";
         fake.pw_uid = (uid_t)-1;          fake.pw_uid = (uid_t)-1;
         fake.pw_gid = (gid_t)-1;          fake.pw_gid = (gid_t)-1;
         fake.pw_class = "";          fake.pw_class = "";
         fake.pw_dir = "/nonexist";          fake.pw_dir = "/nonexist";
         fake.pw_shell = "/nonexist";          fake.pw_shell = "/nonexist";
           done = 1;
   
         return (&fake);          return (&fake);
 }  }

Legend:
Removed from v.1.153  
changed lines
  Added in v.1.154