Commit Graph

2331 Commits

Author SHA1 Message Date
DragonBluep
3102b0b618
pppd: remove redundant rtentry device name init in cifdefaultroute() (#535)
The rtentry device name has already been set in commit:
9856f47063 ("Specify the device name on the default route deletion")

Fixes: 35e5a569c9 (pppd: add support for defaultroute-metric option)

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
2024-11-21 14:17:22 +11:00
Tomas Paukrt
5f6eabdb66
pppd: Fix build without OpenSSL (#533)
The symbol OPENSSL_VERSION_NUMBER is not defined when pppd is
compiled without OpenSSL support, so it evaluates to zero.
This results in the following linker error:

crypto.c:241: undefined reference to `ERR_free_strings'

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2024-11-21 13:53:28 +11:00
Paul Mackerras
616102e93b
Merge pull request #529 from ppp-project/springclean
Springclean
2024-10-29 16:42:46 +11:00
orbea
d72b03393a
pppd: fix build with LibreSSL 4.0.0 (#526)
Starting with LibreSSL 4.0.0 the OPENSSL_load_builtin_modules() function
was removed. It is obsolete after automatic library initialization and
now an internal API.

Signed-off-by: orbea <orbea@riseup.net>
2024-10-29 16:42:18 +11:00
Tomas Paukrt
f7120b5cea
pppd: Fix printing 64-bit counters (#528)
Add support of format specifiers %lld and %llu to the function vslprintf
and use the correct specifiers for printing 64-bit counters.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2024-10-29 16:40:55 +11:00
Paul Mackerras
ef41a6dcb2 Delete samples/options.ttyXX
The commentary and example in this file doesn't seem all that useful.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-10-26 17:02:03 +11:00
Paul Mackerras
c24180bcf8 scripts: Remove some old scripts of dubious value
This removes various scripts and config files that related to dial-up
connections, doing PPP over rsh or ssh (for which there are better
alternatives), and updating resolv.conf (for which distros have other
mechanisms these days).

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-10-25 18:32:14 +11:00
Paul Mackerras
b9e627e212 Remove pppgetpass program
This is associated with the passprompt plugin, and like it, seems not
to be very useful any more now that no-one uses dial-up.  Also, its
function seems somewhat peripheral to PPP.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-10-25 17:29:46 +11:00
Paul Mackerras
0a66ad22e5 pppd: Remove passprompt plugin
This is prompted by a number of factors:

* It was more useful back in the dial-up days, but no-one uses dial-up
  any more

* In many cases there will be no terminal accessible to the prompter
  program at the point where the prompter is run

* The passwordfd plugin does much the same thing but does it more
  cleanly and securely

* The handling of privileges and file descriptors needs to be audited
  thoroughly.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-10-25 17:26:46 +11:00
Paul Mackerras
346125f375 Update version to 2.5.2-dev
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-10-18 20:27:34 +11:00
nasbdh9
ac269dbf7c
pppd/crypto: Fix gcc 14 build (#524)
Fix this:

crypto.c: In function 'PPP_crypto_error':
crypto.c:178:11: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration]
  178 |     off = vsnprintf(buf, len, fmt, args);
      |           ^~~~~~~~~
crypto.c:41:1: note: include '<stdio.h>' or provide a declaration of 'vsnprintf'
   40 | #include "crypto-priv.h"
  +++ |+#include <stdio.h>
   41 |
crypto.c:178:26: warning: 'vsnprintf' argument 2 type is 'int' where 'long unsigned int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
  178 |     off = vsnprintf(buf, len, fmt, args);
      |                          ^~~
<built-in>: note: built-in 'vsnprintf' declared here

Signed-off-by: Tan Zien <nabsdh9@gmail.com>
2024-10-15 13:53:48 +11:00
Paul Mackerras
ff28c30967
Bring Solaris port back up to date (#525)
- Updated READMEs
- Disabled MPPE support for Solaris
- Fixed compilation error in ccp.c with MPPE disabled
- Use OS-provided drivers and associated include files
- Tested on OpenIndiana Hipster (Illumos)

Signed-off-by: James Carlson <carlsonj@workingcode.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Co-authored-by: James Carlson <carlsonj@workingcode.com>
2024-10-15 13:20:29 +11:00
Jaco Kroon
d540579ce5
Export remote_number into REMOTENUMBER environment variable (#521)
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2024-10-14 19:03:09 +11:00
Adrien RICCIARDI
0f6a7c95e1
ci: Update the Solaris action to benefit from the faster VM (#522)
The total execution decreased by about 20%, sometimes even more.

Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
2024-10-14 19:01:50 +11:00
Paul Mackerras
d5aeec6575 Update README to fix an error
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-18 14:30:31 +10:00
Paul Mackerras
8918950194 Update version to 2.5.1 for release
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-18 14:02:31 +10:00
Paul Mackerras
bf52861d25 Update README for 2.5.1 release
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-18 14:02:28 +10:00
Paul Mackerras
367a47aa90 scripts: Update Makefile.am to reflect chatchat removal
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-18 14:02:21 +10:00
Paul Mackerras
1ced44aca8 Remove chatchat program
It is old and unmaintained and I don't think anyone uses it.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-18 13:49:38 +10:00
Paul Mackerras
d0c04daa27 chat: Add copyright notice
This adds a copyright notice in my name with MIT licence permissions
to this file.  The reason is primarily to provide a concrete statement
of permission to use, copy, modify and distribute the program, for the
sake of those who are uncertain about meaning of the public domain.
See for example https://github.com/ppp-project/ppp/issues/474 .
Given that I have maintained this program for 25 years, it seems
reasonable for it to be my copyright on it.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-18 13:48:54 +10:00
Paul Mackerras
53e6846dff
Don't overwrite configuration files in <sysconfdir>/ppp (#518)
This renames the configuration files in etc.ppp/ to have ".example"
on the end of their names.  This is so that when they are copied to
<sysconfdir>/ppp (often /etc/ppp), they don't overwrite existing
pppd configuration files, and it is clear that they are just examples.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-14 13:31:56 +10:00
Paul Mackerras
1d0bff9bc8
pppd: Don't include pppdconf.h in the tarball (#517)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-13 14:08:56 +10:00
Paul Mackerras
e48a9b5de4
Remove Solaris module code (#515)
This code has not been updated for a long time, and nominally targets
an OS whose owner (Oracle) has all but abandoned.  It includes
zlib code which has CVEs against it, and it is unknown whether any
of them would be exploitable in this context.

Illumos, which is an OpenSolaris fork, has forked Solaris-native
drivers, which should probably work with the user-space pppd code
here.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-12 13:57:50 +10:00
Paul Mackerras
5ea05ff8c5 Update README files
- Update README with more of the changes in 2.5.1

- Update the other READMEs lightly, mostly to do with how features are
  included or excluded with the new build system.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-12 13:55:45 +10:00
Paul Mackerras
1889485258 pppd/crypto: Fix #ifdefs that should be #ifs
Since they are testing a condition, they should be #if not #ifdef.

Fixes: 077141058a ("pppd: Add additional functions to handle debugging of crypto calls (#509)", 2024-09-02)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-09-10 21:02:26 +10:00
Paul Mackerras
f891b35364 Merge branch 'net-scripts' of https://github.com/tpaukrt/ppp 2024-09-10 20:18:27 +10:00
Tomas Paukrt
f190e3e3f4
pppd: Add pap-secrets and chap-secrets options (#513)
These options allow a user to specify paths to pap-secrets and chap-secrets files,
which is useful when running multiple instances of pppd that may use the same
username but with different passwords (e.g. running multiple PPTP tunnels).

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2024-09-10 20:15:29 +10:00
Tomas Paukrt
68ccfb3137
pppd: Add noresolvconf option (#512)
This option allows a user to specify that they do not want to
create the /etc/ppp/resolv.conf file with the DNS server addresses.
This can be useful when running on a read-only root filesystem.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2024-09-10 20:14:57 +10:00
Tomas Paukrt
b918c07567
pppd: Add ip-pre-up-script option (#510)
This option allows a user to specify the path to the script
usually located at /etc/ppp/ip-pre-up, similarly to the
existing ip-up-script and ip-down-script options.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2024-09-10 20:13:59 +10:00
enometh
9d8271036d
pppd: Fix reliability of print_link_stats (with option persist) (#505)
* pppd/ipcp.c: (ipcp_down): fix comment
* pppd/main.c: (reset_link_stats): reset print_link_stats to 1, set
start_time even if get_ppp_stats fails.

This is an attempt to fix the problem noted in the linux-ppp mailing list on
mar-26-2024 and may-03-2024 under the subject "ppp-2.5.0 sometimes doesn't
print stats on terminating on signal 2"

The sent/recv log messages were being lost, especially with the persist option.
This seems to be an oversight during reorg in commit ba7f7e0 "Header file
reorganization and cleaning up the public API for pppd version 2.5.0 (#379)"
around the repurposing of the link_stats_valid variable as link_stats_print.

It also fixes a stray reference to the old variable in a comment.

Signed-off-by: S Madhu <enometh@meer.net>
2024-09-10 20:12:35 +10:00
Tomas Paukrt
6f3ee9680e pppd: Add net-init-script, net-pre-up-script and net-down-script options
These options allow a user to specify paths to scripts usually located
at /etc/ppp/net-init, /etc/ppp/net-pre-up and /etc/ppp/net-down,
similarly to the existing ip-up-script and ip-down-script options.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
2024-09-09 18:49:32 +02:00
Eivind Næss
077141058a
pppd: Add additional functions to handle debugging of crypto calls (#509)
Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
2024-09-03 09:41:27 +10:00
Paul Mackerras
6384b10895 scripts/redialer: Change the interpreter to bash since it uses bash syntax
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-21 20:01:59 +10:00
Paul Mackerras
b36a97864d pppd: Log a message when the peer successfully authenticates itself to us
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-21 18:26:49 +10:00
Paul Mackerras
0a35b8ffdb plugins/pppoatm: Remove dead code ans_byaddr and related functions
Provoked by apparent possible out-of-bounds memory access in the
unused code.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-21 17:52:08 +10:00
Paul Mackerras
17f3240570 plugins/pppoatm: Restructure code to avoid possibility of integer overflow
This avoids the theoretical possibility of integer overflow in
adding a constant before dividing in order to get the effect of
rounding up.  Instead we divide and add 1 if the original value modulo
the divisor is non-zero.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-20 20:27:31 +10:00
Paul Mackerras
7eb932ba78 plugins/winbind: Use fclose() to match with fdopen()
Having done fdopen() on a couple of file descriptors, we then need to
use fclose() to close them rather than close().

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-20 19:30:33 +10:00
Paul Mackerras
142a8d4892 pppd: Widen types in ipcp_reqci
The reason is to avoid a theoretically possible overflow of cilen.
Using u_int32_t rather than u_short probably generates better code
on many machines anyway.  Also change l from int to unsigned so as
to avoid any possibility of integer overflow.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-20 18:21:47 +10:00
Paul Mackerras
05b737b37f pppd: Make sure we don't return an initialized CHAP Response length
If anything goes wrong in preparing a CHAP Response, return a 0-length
response instead of leaving the length field uninitialized.  Also
print a warning message to say that something went wrong.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-20 17:31:45 +10:00
Paul Mackerras
2fdc5692ef pppdump: Remove support for decompressing compressed packets
This simplifies the code and reduces its attack surface, in response
to some deficiencies being found in the zlib code.  This should be OK
since probably no-one uses compression on PPP links any more, and in
any case, the code still exists in git if anyone wants it.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-20 17:31:11 +10:00
Paul Mackerras
f8b00fb34b pppd: Remove unused tdb code
Provoked by people doing static analysis and finding deficiencies
in some of the unused code.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-20 17:30:57 +10:00
Paul Mackerras
9b222dbe0e pppd: Fix auth_number() to handle wildcards correctly
Previously auth_number treated all entries in the permitted_numbers
list as if they were wildcards, i.e., as ending in '*', even if there
was no '*'.  This fixes it to only treat entries ending in '*' as
wildcards; without the '*', remote_number has to match the whole entry
exactly.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-08-17 20:43:25 +10:00
Ilya Shipitsin
fa612cba71
pppd/plugins/radius/clientid.c: handle strdup failure (#507)
Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
2024-08-17 13:41:13 +10:00
Jaco Kroon
cb593953b5
plugins/radius: Avoid buffer-overrun in rc_avpair_tostr for PW_TYPE_DATE (#506)
Closes: #499

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
2024-08-17 13:40:49 +10:00
Paul Mackerras
04e6b8dde0
Merge pull request #492 from ppp-project/pppoe
PPPoE fixes and improvements
2024-05-18 10:27:57 +10:00
Paul Mackerras
c8d842b36e plugins/pppoe: Export AC name to scripts via an environment variable
This saves the access concentrator (AC) name supplied by the AC in the
PADO packet and creates an environment variable called "ACNAME" with
the name as its value for scripts to use if desired.

This was inspired by a pull request from "bearmi" on github, but
reimplemented somewhat differently by me.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-05-16 20:31:41 +10:00
Paul Mackerras
2cd2d134fb plugins/pppoe: Use value from pppoe-padi-* options
Reading the values of pppoe_padi_timeout and pppoe_padi_attempts in
PPPOEInitDevice() means that they get sampled when the parsing the
ethernet device name.  If the user provides the pppoe-padi-attempts or
pppoe-padi-timeout option after the ethernet device name, the value
given is effectively ignored.

Instead, read those variables in pppoe_check_options, which is called
after all options have been parsed, so that any user-specified values
don't get missed.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-05-16 20:31:37 +10:00
Pali Rohár
73bd762a65 plugins/pppoe: Remove 5 second delay before PADR in verbose mode
This partially reverts commit 1c082acf77 ("pppoe: Show verbose
information about all concentrator when pppoe-verbose option is set",
2021-01-01).  That commit added a 5-second wait between receiving a
valid PADO and sending the PADR response so as to give time to see
whether any other PADOs arrive.  However, it appears that this delay
causes problems with some concentrators.

This reverts to the previous behaviour of sending the PADR
immediately.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-04-29 12:46:07 +10:00
Paul Mackerras
cc12c3d3ca pppd.8: Document netmask option
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2024-04-27 18:57:29 +10:00
Adrien RICCIARDI
006c81f204
CI: Updated the 'checkout' actions that were using Node.js 16 to Node.js 20. (#489)
See https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20.

Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
2024-04-26 19:11:31 +10:00