7
7
@@ -1442,8 +1442,10 @@ check_passwd(unit, auser, userlen, apass
9
8
if (secret[0] != 0 && !login_secret) {
10
9
/* password given in pap-secrets - must match */
10
if (cryptpap || strcmp(passwd, secret) != 0) {
11
11
+#ifndef NO_CRYPT_HACK
12
if ((cryptpap || strcmp(passwd, secret) != 0)
13
&& strcmp(crypt(passwd, secret), secret) != 0)
12
char *cbuf = crypt(passwd, secret);
13
if (!cbuf || strcmp(cbuf, secret) != 0)
18
18
--- a/pppd/Makefile.linux
19
19
+++ b/pppd/Makefile.linux
20
@@ -116,10 +116,14 @@ COMPILE_FLAGS += -DHAS_SHADOW
20
@@ -121,10 +121,14 @@ CFLAGS += -DHAS_SHADOW
21
21
#LIBS += -lshadow $(LIBS)
24
24
+ifdef NO_CRYPT_HACK
25
+COMPILE_FLAGS += -DNO_CRYPT_HACK
25
+CFLAGS += -DNO_CRYPT_HACK
27
27
ifneq ($(wildcard /usr/include/crypt.h),)
28
COMPILE_FLAGS += -DHAVE_CRYPT_H=1
28
CFLAGS += -DHAVE_CRYPT_H=1
34
CFLAGS += -DHAVE_LOGWTMP=1
35
35
--- a/pppd/session.c
36
36
+++ b/pppd/session.c
37
@@ -348,8 +348,10 @@ session_start(flags, user, passwd, ttyNa
39
* If no passwd, don't let them login if we're authenticating.
37
@@ -351,8 +351,10 @@ session_start(flags, user, passwd, ttyNa
39
if (pw->pw_passwd == NULL || strlen(pw->pw_passwd) < 2)
40
return SESSION_FAILED;
41
41
+#ifndef NO_CRYPT_HACK
42
if (pw->pw_passwd == NULL || strlen(pw->pw_passwd) < 2
43
|| strcmp(crypt(passwd, pw->pw_passwd), pw->pw_passwd) != 0)
42
cbuf = crypt(passwd, pw->pw_passwd);
43
if (!cbuf || strcmp(cbuf, pw->pw_passwd) != 0)
45
45
return SESSION_FAILED;