From 68311c8bb2e7f974b5b91ad61f85980f432f2d7f Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Wed, 12 May 2021 16:08:47 -0400 Subject: system_cmds: shutdown may not work --- system_cmds/passwd.tproj/passwd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'system_cmds/passwd.tproj/passwd.c') diff --git a/system_cmds/passwd.tproj/passwd.c b/system_cmds/passwd.tproj/passwd.c index 877036e..663a40d 100644 --- a/system_cmds/passwd.tproj/passwd.c +++ b/system_cmds/passwd.tproj/passwd.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "passwd.h" #ifdef __SLICK__ @@ -50,7 +51,6 @@ getpasswd(char *name, int isroot, int minlen, int mixcase, int nonalpha, char *p; static char obuf[_PASSWORD_LEN+1]; static char nbuf[_PASSWORD_LEN+1]; - char salt[9]; printf("Changing password for %s.\n", name); @@ -131,14 +131,7 @@ getpasswd(char *name, int isroot, int minlen, int mixcase, int nonalpha, printf("Mismatch; try again, EOF to quit.\n"); } - /* - * Create a random salt - */ - srandom((int)time((time_t *)NULL)); - salt[0] = saltchars[random() % strlen(saltchars)]; - salt[1] = saltchars[random() % strlen(saltchars)]; - salt[2] = '\0'; - *new_pw = crypt(nbuf, salt); + *new_pw = crypt(nbuf, crypt_gensalt("$6$", 0, saltchars, strlen(saltchars))); *old_clear = obuf; *new_clear = nbuf; -- cgit v1.2.3-56-ge451