File: no_crypt_hack

package info (click to toggle)
ppp 2.4.9-1%2B1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,752 kB
  • sloc: ansic: 56,183; sh: 1,079; perl: 334; makefile: 109; exp: 82
file content (47 lines) | stat: -rw-r--r-- 1,194 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
The udeb package does not have crypt(3).
This patch makes authentication always fail, since it is not needed anyway
for dialout.

--- a/pppd/auth.c
+++ b/pppd/auth.c
@@ -1509,8 +1509,10 @@
 	    if (secret[0] != 0 && !login_secret) {
 		/* password given in pap-secrets - must match */
 		if (cryptpap || strcmp(passwd, secret) != 0) {
+#ifndef NO_CRYPT_HACK
 		    char *cbuf = crypt(passwd, secret);
 		    if (!cbuf || strcmp(cbuf, secret) != 0)
+#endif
 			ret = UPAP_AUTHNAK;
 		}
 	    }
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -143,10 +143,14 @@
 #LIBS     += -lshadow $(LIBS)
 endif
 
+ifdef NO_CRYPT_HACK
+CFLAGS += -DNO_CRYPT_HACK
+else
 ifeq ($(shell echo '\#include <crypt.h>' | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
 CFLAGS  += -DHAVE_CRYPT_H=1
 LIBS	+= -lcrypt
 endif
+endif
 
 ifdef USE_LIBUTIL
 CFLAGS	+= -DHAVE_LOGWTMP=1
--- a/pppd/session.c
+++ b/pppd/session.c
@@ -343,8 +343,10 @@
 	 */
         if (pw->pw_passwd == NULL || strlen(pw->pw_passwd) < 2)
             return SESSION_FAILED;
+#ifndef NO_CRYPT_HACK
 	cbuf = crypt(passwd, pw->pw_passwd);
 	if (!cbuf || strcmp(cbuf, pw->pw_passwd) != 0)
+#endif
             return SESSION_FAILED;
     }