version 1.4, 1996/08/30 13:37:53 |
version 1.5, 1997/02/14 23:27:31 |
|
|
static char buf[_PASSWORD_LEN+1]; |
static char buf[_PASSWORD_LEN+1]; |
register char *p, *t; |
register char *p, *t; |
int tries; |
int tries; |
char salt[9], *crypt(), *getpass(); |
char salt[_PASSWORD_LEN], *crypt(), *getpass(); |
|
void pwd_gensalt __P(( char *, int, struct passwd *, char)); |
|
|
printf("Changing YP password for %s.\n", pw->pw_name); |
printf("Changing YP password for %s.\n", pw->pw_name); |
|
|
|
|
break; |
break; |
(void)printf("Mismatch; try again, EOF to quit.\n"); |
(void)printf("Mismatch; try again, EOF to quit.\n"); |
} |
} |
/* grab a random printable character that isn't a colon */ |
pwd_gensalt( salt, _PASSWORD_LEN, pw, 'y' ); |
(void)srandom((int)time((time_t *)NULL)); |
|
#ifdef NEWSALT |
|
salt[0] = _PASSWORD_EFMT1; |
|
to64(&salt[1], (long)(29 * 25), 4); |
|
to64(&salt[5], random(), 4); |
|
#else |
|
to64(&salt[0], random(), 2); |
|
#endif |
|
return(strdup(crypt(buf, salt))); |
return(strdup(crypt(buf, salt))); |
} |
} |
|
|