ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit 5eeef920f00eee50f6fac1992e09e04b218e04e6
parent ed5167e2c167581d59092b75f995655d208363b5
Author: sin <sin@2f30.org>
Date:   Mon,  9 Jun 2014 16:46:30 +0100

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

Diffstat:
Mconfig.def.h | 1+
Mpasswd.c | 5+++--
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -2,3 +2,4 @@ #define ENV_SUPATH "/bin" #define ENV_PATH "/bin" +#define PW_CIPHER "$6$" diff --git a/passwd.c b/passwd.c @@ -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; } }