Add password cipher type in config.def.h - default to SHA-512
This commit is contained in:
parent
ed5167e2c1
commit
5eeef920f0
@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
#define ENV_SUPATH "/bin"
|
#define ENV_SUPATH "/bin"
|
||||||
#define ENV_PATH "/bin"
|
#define ENV_PATH "/bin"
|
||||||
|
#define PW_CIPHER "$6$"
|
||||||
|
5
passwd.c
5
passwd.c
@ -9,6 +9,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include "config.h"
|
||||||
#include "passwd.h"
|
#include "passwd.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -53,14 +54,14 @@ main(int argc, char *argv[])
|
|||||||
if (pw->pw_passwd[0] == '!' ||
|
if (pw->pw_passwd[0] == '!' ||
|
||||||
pw->pw_passwd[0] == '*' ||
|
pw->pw_passwd[0] == '*' ||
|
||||||
pw->pw_passwd[0] == '\0')
|
pw->pw_passwd[0] == '\0')
|
||||||
pw->pw_passwd = "$6$";
|
pw->pw_passwd = PW_CIPHER;
|
||||||
goto newpass;
|
goto newpass;
|
||||||
} else {
|
} else {
|
||||||
if (pw->pw_passwd[0] == '!' ||
|
if (pw->pw_passwd[0] == '!' ||
|
||||||
pw->pw_passwd[0] == '*')
|
pw->pw_passwd[0] == '*')
|
||||||
eprintf("denied\n");
|
eprintf("denied\n");
|
||||||
if (pw->pw_passwd[0] == '\0') {
|
if (pw->pw_passwd[0] == '\0') {
|
||||||
pw->pw_passwd = "$6$";
|
pw->pw_passwd = PW_CIPHER;
|
||||||
goto newpass;
|
goto newpass;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user