diff options
author | Chris Boot <bootc@debian.org> | 2018-11-04 12:56:54 +0000 |
---|---|---|
committer | Chris Boot <bootc@debian.org> | 2018-11-04 12:56:54 +0000 |
commit | 740170227e671620c4f463ac167613f08e41800a (patch) | |
tree | 9677c16eb889247a2055b0b002f1b33910e60381 | |
parent | 12db38473373c1a4fecc819ffe9770f6ebd15a4f (diff) |
no_crypt_hack
The udeb package does not have crypt(3).
This patch makes authentication always fail, since it is not needed anyway
for dialout.
Gbp-Pq: Name no_crypt_hack
-rw-r--r-- | pppd/Makefile.linux | 4 | ||||
-rw-r--r-- | pppd/auth.c | 2 | ||||
-rw-r--r-- | pppd/session.c | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux index 16b3ee8..a8694fc 100644 --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux @@ -121,10 +121,14 @@ CFLAGS += -DHAS_SHADOW #LIBS += -lshadow $(LIBS) endif +ifdef NO_CRYPT_HACK +CFLAGS += -DNO_CRYPT_HACK +else ifneq ($(wildcard /usr/include/crypt.h),) CFLAGS += -DHAVE_CRYPT_H=1 LIBS += -lcrypt endif +endif ifdef USE_LIBUTIL CFLAGS += -DHAVE_LOGWTMP=1 diff --git a/pppd/auth.c b/pppd/auth.c index 4271af6..931c6b4 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -1442,8 +1442,10 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) 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; } } diff --git a/pppd/session.c b/pppd/session.c index 56385dd..9771396 100644 --- a/pppd/session.c +++ b/pppd/session.c @@ -351,8 +351,10 @@ session_start(flags, user, passwd, ttyName, msg) */ 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; } |