- pppd: Check tdb pointer before closing
Check that pointer to the tdb is not NULL before calling tdb_close().
It is possible that the file could not be opened/created due to
permission issues. This change prevents the crash that happens in that
case.
Signed-off-by: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
b6b4d28e0c
- pppd: Fix GLIBC version test for non-glibc toolchains
Non-glibc toolchains have their include files arranged more similar
to newer glibc's than to older.
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
486f854f6a
- pppd: Remove unused rcsid variables
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
d8e8d7a74b
- pppd: Refactor setjmp/longjmp with pipe pair in event wait loop
setjmp/longjmp isn't supported by all compilers.
Having a pipe pair to wake an event wait loop from within a signal handler
is rather portable and common enough.
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
7f2f0deae2
- pppd: Include time.h header before using time_t
Since include/net/ppp_defs.h is used in both kernelspace and userland
it is hard to include <time.h> there.
This commit fixes the problems in userspace code individually and leaves
ppp_defs.h as-is.
Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
57edb1a0eb
- pppd: Use openssl for the DES instead of the libcrypt / glibc
It seems the latest glibc (in Fedora glibc-2.27.9000-12.fc29) dropped
libcrypt. The libxcrypt standalone package can be used instead, but
it dropped the old setkey/encrypt API which ppp uses for DES. There
is support for using openssl in pppcrypt.c, but it contains typos
preventing it from compiling and seems to be written for an ancient
openssl version.
This updates the code to use current openssl.
[paulus@ozlabs.org - wrote the commit description, fixed comment in Makefile.linux.]
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
3c7b86229f
- pppd: Fix variable reference syntax in Makefile.linux
References to the variable called CC in makefiles need to be
written as $(CC) not $CC. Make interprets the latter as a reference
to the (nonexistent) variable C followed by a literal C.
Fixes: 4e71317 ("make: Avoid using host include for cross-compiling")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
d00f8a0e18
- pppd: Eliminate some more compiler warnings
Recent versions of gcc produce warnings on code where strncpy will
produce a result that is not NULL terminated. This changes the
code to eliminate these warnings. In two cases this is done by
changing strncpy to strlcpy, which could in principle cause a loss
of the information in the last byte. This is not a concern in
these cases because:
- In sys-linux.c, the interface names in struct ifreq were possibly
not NULL terminated. The Linux kernel clears the last byte to make
them NULL terminated anyway, so there is no loss of information.
- In session.c, the lastlog ll_line and ll_host fields were possibly
not NULL terminated. These fields are quite long and it is unlikely
that the last byte is needed.
In the other cases strlcpy and strlcat are used to give the same
effect as the old code but without warnings.
This also changes %ld to %d in one place to eliminate a format warning.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
3ea9de9137
- these are changes from the upstream, so they should be added to the source, not patches
- let's hope that we will finally see a new pppd release with these patches already in the sources...
- cosmetics in other patches
- Linux backend: fix ressource leak
Issue detected by Coverity:
22. leaked_handle: Handle variable fd going out of scope leaks the handle.
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
1bb774ca7e
- Linux: Improved system out of memory handling
Maps ENOMEM system error to LIBUSB_ERROR_NO_MEM.
97ece77c4a
- change default MTU/MRU to 1400 (client/pptpd)
- change 'Stateless MPPE' to enabled (client)
These two above changes are essential to get working VPN connection with MIPS routers!
Client:
- GUI: add usage and notes about MTU/MRU problems
PPTPD:
- GUI: add option to choose Auth method (Auto/MS-CHAPv1/MS-CHAPv2)
- move working directory to "/etc/vpn/" (the same as for pptpc_client)
- move MTU clamping rule to the top, so it will be processed before the ACCEPT rule, otherwise it will never be used
- more changes and fixes for pptpd code, configuration, etc (thanks @Merlin)