Add password cipher type in config.def.h - default to SHA-512

This commit is contained in:
sin 2014-06-09 16:46:30 +01:00
parent ed5167e2c1
commit 5eeef920f0
2 changed files with 4 additions and 2 deletions

View File

@ -2,3 +2,4 @@
#define ENV_SUPATH "/bin"
#define ENV_PATH "/bin"
#define PW_CIPHER "$6$"

View File

@ -9,6 +9,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "config.h"
#include "passwd.h"
#include "util.h"
@ -53,14 +54,14 @@ main(int argc, char *argv[])
if (pw->pw_passwd[0] == '!' ||
pw->pw_passwd[0] == '*' ||
pw->pw_passwd[0] == '\0')
pw->pw_passwd = "$6$";
pw->pw_passwd = PW_CIPHER;
goto newpass;
} else {
if (pw->pw_passwd[0] == '!' ||
pw->pw_passwd[0] == '*')
eprintf("denied\n");
if (pw->pw_passwd[0] == '\0') {
pw->pw_passwd = "$6$";
pw->pw_passwd = PW_CIPHER;
goto newpass;
}
}