Import Debian changes 2.4.7-ok1

ppp (2.4.7-ok1) yangtze; urgency=medium

  * Build for openKylin.
This commit is contained in:
openKylinBot 2022-04-25 22:03:04 +08:00
parent 839cb1192c
commit 6d9d8dde68
154 changed files with 16695 additions and 0 deletions

143
debian/README.Debian vendored Normal file
View File

@ -0,0 +1,143 @@
Debian PPP package notes
========================
Table of contents:
+ Provided user space scripts
+ Permissions
+ Outbound dialing setup
+ Inbound setup combined with mgetty
+ Syslog facility level
+ Logging of ip-up and ip-down
+ DSL connections
+ MSS clamping
+ Naming of PPPoE interfaces
-- Christoph Lameter <clameter@debian.org>, 22 July 1997
Phil Hands <phil@hands.com>
Josip Rodin <jrodin@jagor.srce.hr>, 27 November 1999.
Marco d'Itri <md@linux.it>
Provided user space scripts
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Since release 2.3.1, the ppp package provides scripts to conveniently
control PPP from user space. Note that the scripts only work with the
proper setup in /etc/ppp. Edit the configuration files and test the
operation of your link in superuser mode first.
pon Bring link up. Executes pppd (you may specify the ISP name
on the command line), and will immediately return the
command prompt while still dialing.
plog Shows the last lines of the pppd log. Basically, does
tail ppp.log.
poff Bring link down. Terminates connection by killing pppd.
Please read the manual page pon(1) for specific descriptions of these
commands.
Permissions
~~~~~~~~~~~
Access to pppd is controlled via the membership in the "dip" group.
Outbound dialing setup
~~~~~~~~~~~~~~~~~~~~~~
Edit the file /etc/ppp/peers/provider and put all options in it that you need
to connect to your server. The most common options are already provided for
you, and you should only need to set the login name and telephone number.
Edit the file /etc/ppp/pap-secrets and put your password into the designated
location.
You should then be able to start the PPP connection with pon.
You should never need to modify /etc/ppp/options.
If you want to have PPP started at boot time then add something like this
to /etc/network/interfaces:
auto myisp
iface myisp inet ppp
provider dsl-provider
Inbound setup combined with mgetty
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note: for this to work you need to have mgetty version >= 0.99 with its
AutoPPP feature turned on.
Edit the /etc/ppp/options file and uncomment the nameserver lines. Provide
the IP addresses that you want the users to use for their name services.
To have one options file for each serial port you run mgetty on, use
the files /etc/ppp/options.ttyXX. Give each serial port an IP address
in those files. That way that port is locked into using that IP number.
Think what consequences that assignment might have for outbound use...
That should be enough for dial-up from a Win9x or NT Server. The
username/password on those system is used for a PAP authentication.
The /etc/ppp/pap-secrets is already set up for such a situation. Mgetty is
preconfigured to call pppd with parameters so that the PAP verification will
be done through the /etc/passwd file.
All your users should now be able to establish PPP connections by just
specifying phone number, username, and password from Win9x.
Inbound dial-up using dial-up scripts:
A PPP session can be established from the regular Linux prompt by executing
/usr/sbin/pppd. The user is limited to use the assigned IP address in
/etc/ppp/options.ttyname and will not be able to override it.
Note: there is support for callback, it can be done through scripts
(see /usr/share/doc/ppp/examples/scripts/*callback), and with mgetty's
`callback' program (see callback(8) manual page).
Syslog facility level
~~~~~~~~~~~~~~~~~~~~~
The default level of LOG_DAEMON has been overridden (as described in the
pppd(8) man page), to be LOG_LOCAL2. The intent being that local2 be sent
to /var/log/ppp.log for use by plog, if you add the following line to your
/etc/syslog.conf file:
local2.* -/var/log/ppp.log
Logging of ip-up and ip-down
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you want to enable logging of the ip-up and ip-down scripts output,
then create the file /var/log/ppp-ipupdown.log .
DSL connections
~~~~~~~~~~~~~~~
The files peers-pppoa, peers-pppoe and interfaces from
/usr/share/doc/ppp/examples/ contain complete configuration examples
for the protocols commonly used for DSL connections.
Beware: the pppoatm kernel driver currently is not autoloaded, so PPPoA
users probably want to add it to /proc/modules.
The same applies to PPPoE users who need the br2684 module.
MSS clamping
~~~~~~~~~~~~
If the computer running pppd acts as a router for other machines, you
probably want to make it reduce the MSS field of outgoing packets, to
avoid fragmentation and problems caused by path MTU blackholing.
You may add something like this to /etc/ppp/ip-up.d/local:
iptables --insert FORWARD 1 --proto tcp --tcp-flags SYN,RST SYN \
--out-interface $PPP_IFACE --match tcpmss --mss 1400:1536 \
--jump TCPMSS --clamp-mss-to-pmtu
Naming of PPPoE interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~
The rp-pppoe plugin usually accepts only eth*, nas* or tap* as interface
names. Different names can be specified by adding the "nic-" prefix,
which will be removed by the program.

106
debian/README.source vendored Normal file
View File

@ -0,0 +1,106 @@
README.source for ppp
=====================
This is a pretty standard 3.0 (quilt) format package, using debhelper 9. There
are, however, some gotchas that people considring NMUs or other changes must
take into account:
- The package's version number must follow a particular format. See *Version
Number* below.
- There is a symbols file used for tracking the pppd binary's ABI. See *Symbols
File* for more information. The build process is strict about checking the
ABI using the symbols file.
- There are several packages that use ppp-dev to build plugins that may be
loaded into pppd. When adding patches you must be very careful about not
breaking ABI compatibility unnecessarily.
- If you must break ABI compatibility without uploading a new upstream release,
you must bump the ABI tag. See *Version Number* below.
- If you are uploading a new upstream release *or* changing the ABI tag in the
version number, you will effectively trigger a transition. A number of
depending packages will need to be rebuilt and the transition will need to be
managed properly.
Version Number
--------------
Debian Policy §5.6.12 states that there are three parts to a version number of
a package: epoch, upstream_version and debian_revision. For the ppp package the
epoch is currently unused and the upstream_version matches the upstream ppp
package version as you would expect. The debian_revision, however, is special.
Upstream ppp packages cause deliberate ABI breaks with every minor release.
This happens both because the default path which plugins are loaded from
contains the pppd version number, and because plugins should contain a
pppd_version string that matches the pppd version number (which pppd checks at
plugin load). Patches added to ppp in Debian may also silently change the ABI
that plugins expect (e.g. by changing function signatures or names, or changing
structure elements), so we need some additional means to track this.
In order to handle this in as graceful a way as possible, the debian_revision
incorporates an ABI revision field. This field is used to generate Depends or
Breaks entries for packages that build plugins for pppd, and must be present
or the build will fail.
There is currently no automatic tracking of the ABI, so manual care and
attention is required when making changes.
The version of the ppp package looks like::
2.4.7-1+1
+-+-+ | |
| | +--> Usual debian revision field
| +----> ABI version field
+--------> Usual upstream version field
Essentially the debian_revision field is followed immediately by the ABI
revision number, then a plus (+), then what would normally be included in the
debian_revision in any other package.
The ABI revision number must be an integer. Its value starts at one (1) and
must be incremented if the ABI changes without the upstream_version changing.
If the upstream_version field changes, the ABI version should be reset to 1.
If you are uploading an NMU and are confident you are not changing the ABI,
simply add your tag to the end of the version number as usual. The same applies
for security/stable updates and backports, too.
Symbols File
------------
In order to help keep track of the ABI offered to external plugins, this
package uses a symbols file. This is very unconvential for an executable but is
normally considered a requirement for shared libraries. The symbols file is not
currently used beyond the ppp package itself (e.g. plugins have no way of using
the symbols file to generate dependencies at the moment).
This is consulted during the build process and if there are any changes in the
symbols in the binary compared to the symbols file the build will fail. This is
deliberate and helps to indicate that the ABI has changed and an ABI bump is
probably required.
Note that just because there are no changes compared to the symbol file this
does not mean an ABI change has not happened: a patch may well change things
that cannot be tracked using dpkg-gensymbols, for example a C struct may have
members changed which would also change the ABI.
The symbols file is generated using standard unmodified Debian tools. There are
two changes required in order for this to work, though:
1. The pppd binary is built with -Wl,-soname,pppd.so.$(VERSION) to add the
SONAME field to the ELF headers. This is done by patching the Makefile in
debian/patches/pppd-soname-hack.patch.
2. dh_makeshlibs is overridden in debian/rules to force dpkg-gensymbols to
inspect pppd: it normally only looks at files ending ``.so``. The ``-c2``
option is also added to ensure that any added/removed symbols cause the
build to fail.
If the build fails due to changed symbols, you will most likely need to update
the symbols file and bump the ABI revision (see *Version Number*), thus leading
to a transition and rebuilds of any packages that build ppp plugins.
# vim: ft=rst

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
ppp (2.4.7-ok1) yangtze; urgency=medium
* Build for openKylin.
-- openKylinBot <openKylinBot@openkylin.com> Mon, 25 Apr 2022 22:03:04 +0800

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
11

73
debian/control vendored Normal file
View File

@ -0,0 +1,73 @@
Source: ppp
Section: admin
Priority: optional
Homepage: http://ppp.samba.org/
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Chris Boot <bootc@debian.org>
Uploaders: Marco d'Itri <md@linux.it>
Build-Depends:
debhelper (>= 11~),
libpam0g-dev,
libpcap0.8-dev,
libssl-dev,
zlib1g-dev,
Standards-Version: 4.1.3
Vcs-Browser: https://salsa.debian.org/debian/ppp
Vcs-Git: https://salsa.debian.org/debian/ppp.git
Rules-Requires-Root: binary-targets
Package: ppp
Architecture: linux-any
Depends:
libpam-modules,
libpam-runtime,
lsb-base,
procps,
${misc:Depends},
${shlibs:Depends},
Breaks:
network-manager (<< 0.9.8.8-0),
network-manager-pptp (<< 0.9.8.4-0),
pppdcapiplugin (<< 1:3.25+dfsg1-0),
Description: Point-to-Point Protocol (PPP) - daemon
The Point-to-Point Protocol provides a standard way to transmit
datagrams over a serial link, as well as a standard way for the machines
at either end of the link to negotiate various optional characteristics
of the link.
.
This package is most commonly used to manage a modem for dial-up or
certain kinds of broadband connections.
Package: ppp-udeb
Package-Type: udeb
Section: debian-installer
Architecture: amd64 arm64 armhf ppc64el s390x
Depends:
di-utils,
ethernet-card-detection,
ppp-modules,
${misc:Depends},
${shlibs:Depends},
Provides: configured-network
XB-Installer-Menu-Item: 1700
Description: Point-to-Point Protocol (PPP) - package for Debian Installer
The Point-to-Point Protocol provides a standard way to transmit
datagrams over a serial link, as well as a standard way for the machines
at either end of the link to negotiate various optional characteristics
of the link.
.
This package is a minimal ppp package used by the Debian Installer.
Package: ppp-dev
Section: devel
Architecture: all
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends}
Suggests: debhelper
Description: Point-to-Point Protocol (PPP) - development files
The Point-to-Point Protocol provides a standard way to transmit
datagrams over a serial link, as well as a standard way for the machines
at either end of the link to negotiate various optional characteristics
of the link.
.
This package provides files needed to build pppd-related software.

365
debian/copyright vendored Normal file
View File

@ -0,0 +1,365 @@
This is the Debian GNU/Linux prepackaged version of ppp.
This package was previously maintained by Ian Murdock <imurdock@debian.org>,
Alvar Bray <alvar@debian.org>, Christoph Lameter <clameter@debian.org>,
Philip Hands <phil@hands.com>, Michael Beattie <mjb@debian.org> and
Russell Coker <russell@coker.com.au>.
It is currently maintained by Marco d'Itri <md@linux.it>
and Chris Boot <bootc@debian.org>.
Original sources were obtained from:
git://ozlabs.org/~paulus/ppp.git
The options file was originally obtained from:
ftp://sunsite.unc.edu/pub/Linux/system/Network/serial/pppopt.tgz
It was later heavily modified by various people, with additions from
different sources.
All of the code can be freely used and redistributed. The individual
source files each have their own copyright and permission notice; some
have a BSD-style notice and some are under the GPL.
Follows the BSD-like licenses. Not all of them apply to all parts of pppd.
* Copyright (c) 2003 Paul Mackerras. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. The name(s) of the authors of this software must not be used to
* endorse or promote products derived from this software without
* prior written permission.
*
* 3. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Paul Mackerras
* <paulus@samba.org>".
*
* THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* Copyright (c) 1995 Pedro Roque Marques. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The names of the authors of this software must not be used to
* endorse or promote products derived from this software without
* prior written permission.
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Pedro Roque Marques
* <pedro_m@yahoo.com>"
*
* THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* Copyright (c) 1995 Eric Rosenquist. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name(s) of the authors of this software must not be used to
* endorse or promote products derived from this software without
* prior written permission.
*
* THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* Copyright (c) 2002 Google, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name(s) of the authors of this software must not be used to
* endorse or promote products derived from this software without
* prior written permission.
*
* THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* Copyright (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*
* Non-exclusive rights to redistribute, modify, translate, and use
* this software in source and binary forms, in whole or in part, is
* hereby granted, provided that the above copyright notice is
* duplicated in any source form, and that neither the name of the
* copyright holder nor the author is used to endorse or promote
* products derived from this software.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* Copyright (c) 1999 Tommi Komulainen. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name(s) of the authors of this software must not be used to
* endorse or promote products derived from this software without
* prior written permission.
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Tommi Komulainen
* <Tommi.Komulainen@iki.fi>".
*
* THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any legal
* details, please contact
* Office of Technology Transfer
* Carnegie Mellon University
* 5000 Forbes Avenue
* Pittsburgh, PA 15213-3890
* (412) 268-4387, fax: (412) 268-7395
* tech-transfer@andrew.cmu.edu
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Computing Services
* at Carnegie Mellon University (http://www.cmu.edu/computing/)."
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
***********************************************************************
** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
** **
** License to copy and use this software is granted provided that **
** it is identified as the "RSA Data Security, Inc. MD5 Message- **
** Digest Algorithm" in all material mentioning or referencing this **
** software or this function. **
** **
** License is also granted to make and use derivative works **
** provided that such works are identified as "derived from the RSA **
** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
** material mentioning or referencing the derived work. **
** **
** RSA Data Security, Inc. makes no representations concerning **
** either the merchantability of this software or the suitability **
** of this software for any particular purpose. It is provided "as **
** is" without express or implied warranty of any kind. **
** **
** These notices must be retained in any copies of any part of this **
** documentation and/or software. **
***********************************************************************
The `chat' program is in the public domain.
spinlock.c and tdb.c are licensed under the GNU LGPL version 2 or later
and they are:
Copyright (C) Anton Blanchard 2001
Copyright (C) Andrew Tridgell 1999-2004
Copyright (C) Paul `Rusty' Russell 2000
Copyright (C) Jeremy Allison 2000-2003
On Debian systems, the complete text of the GNU General Public License version 2
can be found in `/usr/share/common-licenses/GPL-2'.
pppd/plugins/rp-pppoe/* is:
* Copyright (C) 2000 by Roaring Penguin Software Inc.
*
* This program may be distributed according to the terms of the GNU
* General Public License, version 2 or (at your option) any later version.
The rp-pppoe author stated in a private email to Marco d'Itri that,
as an exception to the license, linking with OpenSSL is allowed.
pppd/plugins/winbind.c is licensed under the GNU GPL version 2 or later
and is:
* Copyright (C) 2003 Andrew Bartlet <abartlet@samba.org>
* Copyright 1999 Paul Mackerras, Alan Curry.
* Copyright (C) 2002 Roaring Penguin Software Inc.
pppd/plugins/pppoatm.c is licensed under the GNU GPL version 2 or later
and is:
* Copyright 2000 Mitchell Blank Jr.
The following copyright notices apply to plugins/radius/*:
Copyright (C) 2002 Roaring Penguin Software Inc.
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this
copyright and permission notice appear on all copies and supporting
documentation, the name of Roaring Penguin Software Inc. not be used
in advertising or publicity pertaining to distribution of the program
without specific prior permission, and notice be given in supporting
documentation that copying and distribution is by permission of
Roaring Penguin Software Inc..
Roaring Penguin Software Inc. makes no representations about the
suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
Copyright (C) 1995,1996,1997,1998 Lars Fenneberg <lf@elemental.net>
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this copyright and
permission notice appear on all copies and supporting documentation, the
name of Lars Fenneberg not be used in advertising or publicity pertaining to
distribution of the program without specific prior permission, and notice be
given in supporting documentation that copying and distribution is by
permission of Lars Fenneberg.
Lars Fenneberg makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or implied
warranty.
Copyright 1992 Livingston Enterprises, Inc.
Livingston Enterprises, Inc. 6920 Koll Center Parkway Pleasanton, CA 94566
Permission to use, copy, modify, and distribute this software for any
purpose and without fee is hereby granted, provided that this copyright
and permission notice appear on all copies and supporting documentation,
the name of Livingston Enterprises, Inc. not be used in advertising or
publicity pertaining to distribution of the program without specific
prior permission, and notice be given in supporting documentation that
copying and distribution is by permission of Livingston Enterprises, Inc.
Livingston Enterprises, Inc. makes no representations about the suitability
of this software for any purpose. It is provided "as is" without express
or implied warranty.
[C] The Regents of the University of Michigan and Merit Network, Inc. 1992,
1993, 1994, 1995 All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided
that the above copyright notice and this permission notice appear in all
copies of the software and derivative works or modified versions thereof,
and that both the copyright notice and this permission and disclaimer
notice appear in supporting documentation.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF THE
UNIVERSITY OF MICHIGAN AND MERIT NETWORK, INC. DO NOT WARRANT THAT THE
FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET LICENSEE'S REQUIREMENTS OR
THAT OPERATION WILL BE UNINTERRUPTED OR ERROR FREE. The Regents of the
University of Michigan and Merit Network, Inc. shall not be liable for any
special, indirect, incidental or consequential damages with respect to any
claim by Licensee or any third party arising from use of the software.
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991.
All rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
* radius.c
*
* Copyright (C) 2002 Roaring Penguin Software Inc.
*
* This plugin may be distributed according to the terms of the GNU
* General Public License, version 2 or (at your option) any later version.

45
debian/extra/README.STATIC-IP vendored Normal file
View File

@ -0,0 +1,45 @@
Static IP addresses support with mgetty/autoPPP
-----------------------------------------------
Debian PPP package includes a variant of ppp-2.3.0-static.diff, a patch to
ppp-2.3.0 to support using static IP addresses with Mgetty and AutoPPP. It
does not affect normal dynamic assignments. There is no need to re-compile
the kernel.
You should update the pap-secrets file to contain the entries of those users
you want to have static IP addresses. Typical entry might look like:
#client server secret IP addresses
jdoe * realpswd 207.69.189.15
* * "" *
Also, inform your static IP users to include their IP when
connecting. E.g. run `pppd 207.69.189.15:`
Or for Windows folks, check the "Specify an IP address" option and
type in the IP.
Note: The second line is what most folks will use to authenticate
users who will be dynamically assigned their addresses by
/dev/ttyXX. This along with the login option allows users to be PAP
authenticated against the /etc/passwd or /etc/shadow. If you enter each and
every user into your pap-secrets file and do not have the last line,
(wildcards line) you MUST place a "*" at the end of each users line.
Without it, the authentication will fail. For example:
#client server secret IP addresses
jdoe * passwd 207.69.189.15 *
This "*" at the end allows the patches to work properly without changing
the normal process. The IP address is normally assigned via the
/etc/ppp/options.ttyXX file. The patches do not interfere with this process
at all. The only thing different is when the user tells pppd he has his own
address, pppd will allow him to use it, if he and his address are
authenticated via the pap-secrets file. The only thing to remember, is tell
your static IP users to set the "correct" IP or they will be assigned the
normal dynamic address. (And of course that's not what we want :>) If you
have any questions....
While I tested this as many ways as our systems would allow, no warranty
is implied. They work well for us.
Author: Jeff Myers <jmyers@southcom.net>

35
debian/extra/README.win9x vendored Normal file
View File

@ -0,0 +1,35 @@
Short guide on how to run a Win9x connection with PPPD to Debian Linux
----------------------------------------------------------------------
1. Do not mess around with the Win9x configuration.
Do not manually configure DNS, scripts etc.
Do not switch on the terminal windows.
Accept all defaults or better leave it as it was at installation.
2. You need to have a getty program that supports automatic PPP protocol
detection, such as mgetty (versions >= 0.99).
Note: the mgetty shipped with Debian has to be set up to enable this
behaviour - look for "AutoPPP" in the login.config configuration file.
3. Change the "ms-dns" lines in /etc/ppp/options, and review the complete
file for things you need to do.
4. Make sure that your /etc/ppp/pap-secrets file is set up to allow users
mentioned in system passwords database (/etc/passwd) to establish PPP
connections using their normal password.
Note: the pap-secrets file shipped with Debian pppd is set up to enable
this by default.
5. On the Win9x box, in Dial-Up Networking folder, create a new connection,
and enter the phone number. Prior to connecting, enter the username and
password.
Win9x should connect to your Linux PPPD without problems and automatically
configure IP addresses, the netmask and the DNS servers. You can immediately
start Netscape, Internet Explorer or any other TCP/IP tools.
-- Christoph Lameter <clameter@debian.org>, 27 September, 1996,
Josip Rodin <jrodin@jagor.srce.hr>, 27 November 1999,
Michael Beattie <mjb@debian.org>, 9 April 2001.

181
debian/extra/autopppd vendored Normal file
View File

@ -0,0 +1,181 @@
#!/usr/bin/perl -w
# From: Brian May <bam@snoopy.apana.org.au>
# To: Debian Bug Tracking System <submit@bugs.debian.org>
# Subject: ppp: Increase redial time with each failed PPP connection attempt
# Date: Fri, 04 Oct 2002 10:02:50 +1000
# Message-Id: <20021004000251.9396ECD17@scrooge.chocbit.org.au>
#
# Package: ppp
# Version: 2.4.1.uus-4
# Severity: normal
# Tags: patch
#
# Suggested script to include. It means that each time to
# connect is made longer, so that you don't get a huge bill if
# for some reason the modem connects but a PPP connection cannot
# be established:
#
# This program depends on libproc-daemon-perl and libproc-waitstat-perl .
use Proc::Daemon;
use strict;
use Sys::Syslog qw(:DEFAULT setlogsock); # default set, plus setlogsock
use Proc::WaitStat qw(:DEFAULT waitstat);
Proc::Daemon::Init;
my $pidfile = '/var/run/autopppd.pid';
open(PIDFILE, $pidfile);
print(PIDFILE "$$\n");
close(PIDFILE);
sub toseconds($) {
my ($hours,$minutes,$seconds) = split(/:/,shift);
return ($hours*60+$minutes)*60+$seconds;
}
sub dseconds($) {
my ($total) = @_;
my $seconds = $total % 60; $total = ($total - $seconds)/60;
my $minutes = $total % 60; $total = ($total - $minutes)/60;
my $hours = $total % 24; $total = ($total - $hours)/24;
my $days = $total;
if ($days > 0) {
return(sprintf("%d-%02d:%02d:%02d",$days,$hours,$minutes,$seconds));
} else {
return(sprintf("%02d:%02d:%02d",$hours,$minutes,$seconds));
}
}
my $program="autopppd";
setlogsock('unix');
openlog($program, 'cons,pid', 'daemon');
my $pppd_start_time;
my $pppd_end_time;
my $pppd_run_time;
my $pppd_fail;
my $delay=0;
my $idelay=0;
my @delays = (
toseconds("00:01:00"), # 1 minute
toseconds("00:07:00"), # 8 minutes
toseconds("00:07:00"), # 15 minutes
toseconds("00:15:00"), # 30 minutes
toseconds("00:30:00"), # 1 hour
toseconds("01:00:00"), # 2 hours
toseconds("01:00:00"), # 3 hours
toseconds("03:00:00"), # 6 hours
toseconds("06:00:00"), # 12 hours
toseconds("12:00:00"), # 24 hours
toseconds("24:00:00") # 48 hours
);
# action == 0 => immediate retry (!FIXME! needs to have some delay)
# action == 1 => delayed retry
# action == 2 => abort
my $code = {
0 => { message=>"pppd detached", action=> 2 },
1 => { message=>"fatal error", action=> 2 },
2 => { message=>"options error", action=> 2 },
3 => { message=>"not setuid-root error", action=> 2 },
4 => { message=>"no kernel support for PPP", action=> 2 },
5 => { message=>"SIGINT or SIGTERM or SIGHUP", action=> 1 },
6 => { message=>"Serial port locked", action=> 1 }, # should be 0
7 => { message=>"Serial port open error", action=> 1 },
8 => { message=>"Connect failed", action=> 1 },
9 => { message=>"Could not execute pty command", action=> 1 },
10 => { message=>"PPP negotiation failed", action=> 1 },
11 => { message=>"Peer failed to authenticate", action=> 1 },
12 => { message=>"Link was idle", action=> 1 },
13 => { message=>"Time limit exceeded", action=> 1 },
14 => { message=>"call back not implemented", action=> 2 },
15 => { message=>"peer not responding", action=> 1 },
16 => { message=>"modem hang up", action=> 1 },
17 => { message=>"Serial loopback detected", action=> 1 },
18 => { message=>"Init script failed", action=> 1 },
19 => { message=>"We failed to authenticate", action=> 1 },
};
while (1)
{
$pppd_start_time=time;
syslog('info', 'restarting pppd');
# logging sometimes stopped working after ppp was running for
# some time. lets see if closing and reopening the log file helps...
closelog();
# run ppp
my $rc=system("pppd","-detach",@ARGV);
# reopon log file
openlog($program, 'cons,pid', 'daemon');
# calculate run time
$pppd_end_time=time;
$pppd_run_time=$pppd_end_time-$pppd_start_time;
my $pppd_code = ($? >> 8);
my $pppd_signal = $? & 127;
my $pppd_coredump = $? & 128;
$pppd_fail = 1;
if ($pppd_signal != 0) {
if ($pppd_coredump)
{ syslog('err',"pppd died with signal $pppd_signal, coredump"); }
else
{ syslog('err',"pppd died with signal $pppd_signal"); }
}
elsif ($pppd_coredump) {
syslog('err',"pppd died with coredump");
}
elsif (defined($code->{$pppd_code}) && $code->{$pppd_code}{"action"} == 0) {
syslog('err', "pppd returned: ".$code->{$pppd_code}{"message"}." ($pppd_code), immediate retry");
$pppd_fail = 0;
}
elsif (defined($code->{$pppd_code}) && $code->{$pppd_code}{"action"} == 1) {
syslog('err', "pppd returned: ".$code->{$pppd_code}{"message"}." ($pppd_code), delayed retry");
$pppd_fail = 1;
}
elsif (defined($code->{$pppd_code}) && $code->{$pppd_code}{"action"} >= 2) {
syslog('err', "pppd returned: ".$code->{$pppd_code}{"message"}." ($pppd_code), aborting");
exit(255);
unlink $pidfile;
}
elsif (defined($code->{$pppd_code}) && $code->{$pppd_code}{"action"} >= 2) {
syslog('err', "pppd returned: unknown error ($pppd_code), delayed retry");
$pppd_fail = 1;
}
# if it hasn't ran for at least an hour, then somthing went wrong
elsif ($pppd_run_time < toseconds("01:00:00")) {
syslog('err',"pppd session didn't last 1 hour, delayed retry");
$pppd_fail = 1;
}
else { $pppd_fail = 0; }
# if not failed, then reset delay.
if (!$pppd_fail) { $idelay = 0; }
# get next delay.
$delay = $delays[$idelay];
# log statistics.
syslog('info',"rc=".waitstat($rc)." runtime=".dseconds($pppd_run_time)." delay[$idelay]=".dseconds($delay)."");
# delay for desired time.
sleep($delay);
# increment delay for next time.
if (defined($delays[$idelay+1])) { $idelay++; }
}
closelog();
unlink $pidfile;

31
debian/extra/bash_completion/poff vendored Normal file
View File

@ -0,0 +1,31 @@
# Debian GNU/Linux pon/poff(1) completion
# Copyright 2002 Baruch Even <baruch@debian.org>
# License: GNU GPL v2 or later
_poff()
{
local prev cur conns
[ -r /etc/ppp/peers/ ] || return 0
COMPREPLY=()
prev=${COMP_WORDS[COMP_CWORD-1]}
cur=${COMP_WORDS[COMP_CWORD]}
conns=$(\ls --color=none /etc/ppp/peers | egrep -v '(\.bak|~)$')
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W '-r -d -c -a -h -v' -- $cur) )
return 0
fi
# first parameter on line or first since an option?
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" != -* ]] || \
[[ "$prev" == -* ]]; then
COMPREPLY=( $(compgen -o filenames -W "$conns" $cur) )
fi
return 0
}
complete -F _poff poff
# vim:ft=sh:

23
debian/extra/bash_completion/pon vendored Normal file
View File

@ -0,0 +1,23 @@
# Debian GNU/Linux pon/poff(1) completion
# Copyright 2002 Baruch Even <baruch@debian.org>
# License: GNU GPL v2 or later
_pon()
{
local cur conns
[ -r /etc/ppp/peers/ ] || return 0
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
conns=$(\ls --color=none /etc/ppp/peers | egrep -v '(\.bak|~)$')
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $(compgen -o filenames -W "$conns" $cur) )
fi
return 0
}
complete -F _pon pon
# vim:ft=sh:

4
debian/extra/chap-secrets vendored Normal file
View File

@ -0,0 +1,4 @@
# Secrets for authentication using CHAP
# client server secret IP addresses

38
debian/extra/chatscripts/gprs vendored Normal file
View File

@ -0,0 +1,38 @@
# You can use this script unmodified to connect to cellular networks.
# The APN is specified in the peers file as the argument of the -T command
# line option of chat(8).
# For details about the AT commands involved please consult the relevant
# standard: 3GPP TS 27.007 - AT command set for User Equipment (UE).
# (http://www.3gpp.org/ftp/Specs/html-info/27007.htm)
ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
ABORT "DELAYED"
ABORT "ERROR"
# cease if the modem is not attached to the network yet
ABORT "+CGATT: 0"
"" AT
TIMEOUT 12
OK ATH
OK ATE1
# +CPIN provides the SIM card PIN
#OK "AT+CPIN=1234"
# +CFUN may allow to configure the handset to limit operations to
# GPRS/EDGE/UMTS/etc to save power, but the arguments are not standard
# except for 1 which means "full functionality".
#OK AT+CFUN=1
OK AT+CGDCONT=1,"IP","\T","",0,0
OK ATD*99#
TIMEOUT 22
CONNECT ""

22
debian/extra/chatscripts/pap vendored Normal file
View File

@ -0,0 +1,22 @@
# You can use this script unmodified to connect to sites which allow
# authentication via PAP, CHAP and similar protocols.
# This script can be shared among different pppd peer configurations.
# To use it, add something like this to your /etc/ppp/peers/ file:
#
# connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T PHONE-NUMBER"
# user YOUR-USERNAME-IN-PAP-SECRETS
# noauth
# Uncomment the following line to see the connect speed.
# It will be logged to stderr or to the file specified with the -r chat option.
#REPORT CONNECT
ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
"" ATZ
OK ATDT\T
CONNECT ""

51
debian/extra/defaultroute vendored Normal file
View File

@ -0,0 +1,51 @@
From: Marek Michalkiewicz <marekm@linux.org.pl>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#85426: default route uses wrong interface with the same IP address
Package: ppp
Version: 2.4.0f-1
Severity: wishlist
The pppd "defaultroute" option, when the ppp0 interface comes up, seems
to do the equivalent of "route add default gw $ip_address", and I think
it should do the equivalent of "route add default dev ppp0" instead.
In most normal cases this shouldn't matter (because each interface has
its own unique IP address), but specifying the interface by name (not
by its IP address) may be preferable if there is more than one interface
with the same IP address.
I have a dummy0 interface with the same IP address as that of ppp0.
This makes it possible to connect to the box from the internal LAN
using its normal hostname (even if ppp0 is down at the moment), and
to run named (possibly started before ppp0 comes up) as non-root.
Using the "defaultroute" option causes pppd to set up the default route
via dummy0 (first device found with matching IP address), not ppp0.
I've worked around this by disabling the pppd defaultroute option and
creating a small shell script called /etc/ppp/ip-up.d/000defaultroute
(run before 00ipmasq) with the following contents:
#! /bin/sh
set -e
/sbin/route add default dev $PPP_IFACE
This gets the default route right (no corresponding ip-down script is
necessary - when ppp0 goes down, the route is removed automatically).
Please consider at least documenting this workaround, as I think it
may be useful to someone.
Thanks,
Marek
-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux alf 2.2.19pre7 #1 Sat Jan 27 15:26:41 CET 2001 i586
Versions of packages ppp depends on:
ii libc6 2.2.1-1 GNU C Library: Shared libraries an
ii libpam-modules 0.72-12 Pluggable Authentication Modules f
ii libpam0g 0.72-12 Pluggable Authentication Modules l
ii netbase 4.05 Basic TCP/IP networking system
ii sysvinit 2.78-4 System-V like init.

194
debian/extra/dh_ppp vendored Executable file
View File

@ -0,0 +1,194 @@
#!/usr/bin/perl -w
=head1 NAME
dh_ppp - calculate ppp dependencies
=cut
use strict;
use warnings;
use Debian::Debhelper::Dh_Lib;
use Dpkg::Shlibs::Objdump;
use File::Find;
=head1 SYNOPSIS
B<dh_ppp> [S<I<debhelper options>>] [B<--breaks>] [B<--force>] [B<--plugin-dir>]
=head1 DESCRIPTION
B<dh_ppp> is a debhelper program that adds appropriate ppp dependencies on
packages that build pppd plugins.
By default, some entries are added to B<misc:Depends> that ensure that
packages which contain plugins that are loaded into pppd depend on an
appropriate version of the ppp package.
You may prefer to use a B<Breaks> relationship instead, for example if your
package supplies a pppd plugin but does not require it for normal operation. In
that case you should supply the B<--breaks> option and B<misc:Breaks> will be
populated instead of B<misc:Depends>.
Substvars entries are only added if a pppd plugin is detected in the build
products, unless B<--force> is specified. Plugins are detected by searching a
package's build products for libraries with a symbol named B<plugin_init>.
A warning is emitted if a plugin is found that does not also contain a
B<pppd_version> symbol.
Please note there is a B<dh> addon named B<ppp> which can be used to
automatically invoke B<dh_ppp> for you.
=head1 FILES
=over 4
=item /usr/share/ppp-dev/substvars
Template substitution variables. The values in this file are used when
populating the B<misc:Depends> or B<misc:Breaks> substition variables, or they
may be manually copied into a package's substvars if one wishes not to use
B<dh_ppp>.
=back
=head1 OPTIONS
=over 4
=item B<--breaks>
Rather than populating B<misc:Depends> to ensure an appropriate version of
B<ppp> is used, populate B<misc:Breaks> such that a inappropriate version of
B<ppp> may not be used.
=item B<--force>
Do not try to detect pppd plugins in the package, and always assume that a
plugin is present. This will cause B<misc:Depends> (or B<misc:Breaks>) to
always be populated.
=item B<--plugin-dir>
Simply outputs the path to the pppd plugins directory for the current ABI
version. When this flag is specified, B<dh_ppp> makes no attempt to detect any
plugins nor does it update any substitution variables.
=back
=head1 NOTES
Note that this command is not idempotent. L<dh_prep(1)> should be called
between invocations of this command (with the same arguments). Otherwise, it
may cause multiple instances of the same text to be added to the substition
variables.
Note that B<dh_ppp> should be run before B<dh_gencontrol>. The B<ppp> sequence
addon for B<dh> does the right thing, this note is only relevant when you are
calling B<dh_ppp> manually.
=cut
init(options => {
"breaks" => \$dh{BREAKS},
"force" => \$dh{FORCE},
"plugin-dir" => \$dh{PLUGIN_DIR},
});
sub detect_plugins {
my $package = shift;
my $tmpdir = tmpdir($package);
my @shared_objects;
my @plugins;
find({
wanted => sub {
my $name = $File::Find::name;
return unless -f $name;
return unless $name =~ m,^$tmpdir/usr/lib/.*\.so$,;
push @shared_objects, $name;
},
no_chdir => 1,
}, $tmpdir);
my $od = new Dpkg::Shlibs::Objdump();
for my $so (@shared_objects) {
verbose_print("Scanning $so for symbol information");
my $objid = $od->analyze($so);
unless (defined($objid) && $objid) {
warning("Dpkg::Shlibs::Objdump couldn't parse $so");
next;
}
my $object = $od->get_object($objid);
my $init = $object->get_symbol("plugin_init");
if (!defined($init)) {
verbose_print("File $so does not look like a pppd " .
"plugin. Ignoring.");
next;
}
push @plugins, $so;
my $ver = $object->get_symbol("pppd_version");
if (!defined($ver)) {
warning("File $so looks like a pppd plugin but " .
"lacks a pppd_version symbol!");
}
}
return @plugins;
}
my %substvars;
sub load_substvars {
return if %substvars;
open(VARS, '<', '/usr/share/ppp-dev/substvars') or
error("Failed to load template substvars");
while (<VARS>) {
chomp;
my ($var, $value) = split /=/, $_, 2;
my @pkgs = split /, /, $value;
$substvars{$var} = \@pkgs;
}
close(VARS);
for my $var (qw(ppp:Depends ppp:Breaks)) {
error("$var not defined in substvars template")
unless defined($substvars{$var});
}
}
if ($dh{PLUGIN_DIR}) {
inhibit_log();
load_substvars();
print join(', ', @{$substvars{'ppp:PluginDir'}}) . "\n";
exit 0;
}
foreach my $package (@{$dh{DOPACKAGES}}) {
next unless $dh{FORCE} or detect_plugins($package);
load_substvars();
my $var = $dh{BREAKS} ? 'Breaks' : 'Depends';
for my $pkg (@{$substvars{"ppp:$var"}}) {
addsubstvar($package, "misc:$var", $pkg);
}
}
=head1 SEE ALSO
L<debhelper(7)>
=head1 AUTHORS
Chris Boot <bootc@debian.org>
=cut

14
debian/extra/filters vendored Normal file
View File

@ -0,0 +1,14 @@
#
# These filter rules should prevent unwanted internet services to
# keep your connections up by ignoring their connection requests
# and your 'go way' responses.
#
# Activate them by activating the line 'file /etc/ppp/filters' in
# /etc/ppp/options.
#
# Note: This has nothing to do with firewall rules. It only affects
# the idle time calculation of the kernel/pppd.
#
active-filter 'outbound and not icmp[0] == 3 and not tcp[13] & 4 != 0'

51
debian/extra/interfaces vendored Normal file
View File

@ -0,0 +1,51 @@
# copy one of these examples to /etc/network/interfaces
# The VP, VC and encapsulation must match the ones used by your ISP, these
# examples use 8.35 with LLC encapsulation and assume that ATM interface
# 0 is the DSL modem.
# br2684ctl and atmarp are part of the br2684ctl and atm-tools packages,
# check the atmarp(8) and br2684ctl(8) man pages for details about the
# command line options.
# PPPoE
# You need to create an appropriate /etc/ppp/peers/pppoe file, look at
# /usr/share/doc/ppp/examples/peers-pppoe for an example and configure it
# to use the nas0 interface.
auto pppoe
iface pppoe inet ppp
provider pppoe
pre-up br2684ctl -b -c 0 -a 0.8.35
pre-up ip link set up nas0
post-down kill $(cat /var/run/nas0.pid)
# RFC 1483 bridged, with dynamically assigned address
auto nas0
iface nas0 inet dhcp
pre-up br2684ctl -b -c ${IFACE#nas} -a 0.8.35
post-down kill $(cat /var/run/$IFACE.pid)
# RFC 1483 bridged, with statically assigned address
auto nas0
iface nas0 inet static
address 192.0.2.1
netmask 255.255.255.0
broadcast 192.0.2.255
gateway 192.0.2.254
pre-up br2684ctl -b -c ${IFACE#nas} -a 0.8.35
post-down kill $(cat /var/run/$IFACE.pid)
# Classical IP over ATM (CLIP)
# This assumes that atmarpd is already running.
auto atm0
iface atm0 inet static
address 192.0.2.1
netmask 255.255.255.0
broadcast 192.0.2.255
gateway 192.0.2.254
pre-up atmarp -c $IFACE
post-up atmarp -s 192.0.2.254 0.8.35

52
debian/extra/ip-down vendored Executable file
View File

@ -0,0 +1,52 @@
#!/bin/sh
#
# This script is run by the pppd _after_ the link is brought down.
# It uses run-parts to run scripts in /etc/ppp/ip-down.d, so to delete
# routes, unset IP addresses etc. you should create script(s) there.
#
# Be aware that other packages may include /etc/ppp/ip-down.d scripts (named
# after that package), so choose local script names with that in mind.
#
# This script is called with the following arguments:
# Arg Name Example
# $1 Interface name ppp0
# $2 The tty ttyS1
# $3 The link speed 38400
# $4 Local IP number 12.34.56.78
# $5 Peer IP number 12.34.56.99
# $6 Optional ``ipparam'' value foo
# The environment is cleared before executing this script
# so the path must be reset
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH
# These variables are for the use of the scripts run by run-parts
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
# as an additional convenience, $PPP_TTYNAME is set to the tty name,
# stripped of /dev/ (if present) for easier matching.
PPP_TTYNAME=`/usr/bin/basename "$2"`
export PPP_TTYNAME
# If /var/log/ppp-ipupdown.log exists use it for logging.
if [ -e /var/log/ppp-ipupdown.log ]; then
exec >> /var/log/ppp-ipupdown.log 2>&1
echo $0 $@
echo
fi
# This script can be used to override the .d files supplied by other packages.
if [ -x /etc/ppp/ip-down.local ]; then
exec /etc/ppp/ip-down.local "$@"
fi
run-parts /etc/ppp/ip-down.d \
--arg="$1" --arg="$2" --arg="$3" --arg="$4" --arg="$5" --arg="$6"

24
debian/extra/ip-down.d/0000usepeerdns vendored Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh -e
# exit if the resolvconf package is installed
[ -x /sbin/resolvconf ] && exit 0
# follow any symlink to find the real file
if [ -e /etc/resolv.conf ]; then
REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
else
REALRESOLVCONF=/etc/resolv.conf
fi
# if an old resolv.conf file exists, restore it
if [ -e $REALRESOLVCONF.pppd-backup.$PPP_IFACE ]; then
mv -f $REALRESOLVCONF.pppd-backup.$PPP_IFACE $REALRESOLVCONF
# restart nscd because resolv.conf has changed
if [ -e /var/run/nscd.pid ]; then
/etc/init.d/nscd restart || true
fi
fi
exit 0

59
debian/extra/ip-up vendored Executable file
View File

@ -0,0 +1,59 @@
#!/bin/sh
#
# This script is run by the pppd after the link is established.
# It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add routes,
# set IP address, run the mailq etc. you should create script(s) there.
#
# Be aware that other packages may include /etc/ppp/ip-up.d scripts (named
# after that package), so choose local script names with that in mind.
#
# This script is called with the following arguments:
# Arg Name Example
# $1 Interface name ppp0
# $2 The tty ttyS1
# $3 The link speed 38400
# $4 Local IP number 12.34.56.78
# $5 Peer IP number 12.34.56.99
# $6 Optional ``ipparam'' value foo
# The environment is cleared before executing this script
# so the path must be reset
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH
# These variables are for the use of the scripts run by run-parts
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
# as an additional convenience, $PPP_TTYNAME is set to the tty name,
# stripped of /dev/ (if present) for easier matching.
PPP_TTYNAME=`/usr/bin/basename "$2"`
export PPP_TTYNAME
# If /var/log/ppp-ipupdown.log exists use it for logging.
if [ -e /var/log/ppp-ipupdown.log ]; then
exec > /var/log/ppp-ipupdown.log 2>&1
echo $0 $@
echo
fi
# This script can be used to override the .d files supplied by other packages.
if [ -x /etc/ppp/ip-up.local ]; then
exec /etc/ppp/ip-up.local "$@"
fi
run-parts /etc/ppp/ip-up.d \
--arg="$1" --arg="$2" --arg="$3" --arg="$4" --arg="$5" --arg="$6"
# if pon was called with the "quick" argument, stop pppd
if [ -e /var/run/ppp-quick ]; then
rm /var/run/ppp-quick
wait
kill $PPPD_PID
fi

40
debian/extra/ip-up.d/0000usepeerdns vendored Executable file
View File

@ -0,0 +1,40 @@
#!/bin/sh -e
# this variable is only set if the usepeerdns pppd option is being used
[ "$USEPEERDNS" ] || exit 0
# exit if the resolvconf package is installed
[ -x /sbin/resolvconf ] && exit 0
case "$6" in
nm-pptp-service-*|nm-l2tp-service-*|/org/freedesktop/NetworkManager/PPP/*)
# NetworkManager handles it
exit 0
;;
esac
# create the file if it does not exist
if [ ! -e /etc/resolv.conf ]; then
: > /etc/resolv.conf
fi
# follow any symlink to find the real file
REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
# merge the new nameservers with the other options from the old configuration
{
cat /etc/ppp/resolv.conf
grep --invert-match '^nameserver[[:space:]]' "$REALRESOLVCONF" || true
} > "$REALRESOLVCONF.tmp"
# backup the old configuration and install the new one
cp -a "$REALRESOLVCONF" "$REALRESOLVCONF.pppd-backup.$PPP_IFACE"
mv -f "$REALRESOLVCONF.tmp" "$REALRESOLVCONF"
# restart nscd because resolv.conf has changed
if [ -e /var/run/nscd.pid ]; then
/etc/init.d/nscd restart || true
fi
exit 0

28
debian/extra/ipv6-down vendored Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
# These variables are for the use of the scripts run by run-parts.
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
# The environment is cleared before executing this script.
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH
# If /var/log/ppp-ipupdown.log exists use it for logging.
if [ -e /var/log/ppp-ipupdown.log ]; then
exec >> /var/log/ppp-ipupdown.log 2>&1
fi
# This script can be used to override the .d files supplied by other packages.
if [ -x /etc/ppp/ipv6-down.local ]; then
exec /etc/ppp/ipv6-down.local "$@"
fi
run-parts /etc/ppp/ipv6-down.d \
--arg="$1" --arg="$2" --arg="$3" --arg="$4" --arg="$5" --arg="$6"

35
debian/extra/ipv6-up vendored Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
# These variables are for the use of the scripts run by run-parts.
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
# The environment is cleared before executing this script.
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH
# If /var/log/ppp-ipupdown.log exists use it for logging.
if [ -e /var/log/ppp-ipupdown.log ]; then
exec >> /var/log/ppp-ipupdown.log 2>&1
fi
# This script can be used to override the .d files supplied by other packages.
if [ -x /etc/ppp/ipv6-up.local ]; then
exec /etc/ppp/ipv6-up.local "$@"
fi
run-parts /etc/ppp/ipv6-up.d \
--arg="$1" --arg="$2" --arg="$3" --arg="$4" --arg="$5" --arg="$6"
# if pon was called with the "quick" argument, stop pppd
if [ -e /var/run/ppp-quick ]; then
rm /var/run/ppp-quick
wait
kill $PPPD_PID
fi

View File

@ -0,0 +1,10 @@
#!/usr/bin/perl
use strict;
use warnings;
use Debian::Debhelper::Dh_Lib;
# dh_ppp runs unconditionally, and before dh_gencontrol, so that the latter can
# use the substvars that are put into place by the former.
insert_before("dh_gencontrol", "dh_ppp");
1;

348
debian/extra/options vendored Normal file
View File

@ -0,0 +1,348 @@
# /etc/ppp/options
#
# Originally created by Jim Knoble <jmknoble@mercury.interpath.net>
# Modified for Debian by alvar Bray <alvar@meiko.co.uk>
# Modified for PPP Server setup by Christoph Lameter <clameter@debian.org>
#
# To quickly see what options are active in this file, use this command:
# egrep -v '#|^ *$' /etc/ppp/options
# Specify which DNS Servers the incoming Win95 or WinNT Connection should use
# Two Servers can be remotely configured
# ms-dns 192.168.1.1
# ms-dns 192.168.1.2
# Specify which WINS Servers the incoming connection Win95 or WinNT should use
# ms-wins 192.168.1.50
# ms-wins 192.168.1.51
# Run the executable or shell command specified after pppd has
# terminated the link. This script could, for example, issue commands
# to the modem to cause it to hang up if hardware modem control signals
# were not available.
#disconnect "chat -- \d+++\d\c OK ath0 OK"
# async character map -- 32-bit hex; each bit is a character
# that needs to be escaped for pppd to receive it. 0x00000001
# represents '\x01', and 0x80000000 represents '\x1f'.
asyncmap 0
# Require the peer to authenticate itself before allowing network
# packets to be sent or received.
# Please do not disable this setting. It is expected to be standard in
# future releases of pppd. Use the call option (see manpage) to disable
# authentication for specific peers.
auth
# Use hardware flow control (i.e. RTS/CTS) to control the flow of data
# on the serial port.
crtscts
# Use software flow control (i.e. XON/XOFF) to control the flow of data
# on the serial port.
#xonxoff
# Specifies that certain characters should be escaped on transmission
# (regardless of whether the peer requests them to be escaped with its
# async control character map). The characters to be escaped are
# specified as a list of hex numbers separated by commas. Note that
# almost any character can be specified for the escape option, unlike
# the asyncmap option which only allows control characters to be
# specified. The characters which may not be escaped are those with hex
# values 0x20 - 0x3f or 0x5e.
#escape 11,13,ff
# Don't use the modem control lines.
#local
# Specifies that pppd should use a UUCP-style lock on the serial device
# to ensure exclusive access to the device.
lock
# Don't show the passwords when logging the contents of PAP packets.
# This is the default.
hide-password
# When logging the contents of PAP packets, this option causes pppd to
# show the password string in the log message.
#show-password
# Use the modem control lines. On Ultrix, this option implies hardware
# flow control, as for the crtscts option. (This option is not fully
# implemented.)
modem
# Set the MRU [Maximum Receive Unit] value to <n> for negotiation. pppd
# will ask the peer to send packets of no more than <n> bytes. The
# minimum MRU value is 128. The default MRU value is 1500. A value of
# 296 is recommended for slow links (40 bytes for TCP/IP header + 256
# bytes of data).
#mru 542
# Set the interface netmask to <n>, a 32 bit netmask in "decimal dot"
# notation (e.g. 255.255.255.0).
#netmask 255.255.255.0
# Disables the default behaviour when no local IP address is specified,
# which is to determine (if possible) the local IP address from the
# hostname. With this option, the peer will have to supply the local IP
# address during IPCP negotiation (unless it specified explicitly on the
# command line or in an options file).
#noipdefault
# Enables the "passive" option in the LCP. With this option, pppd will
# attempt to initiate a connection; if no reply is received from the
# peer, pppd will then just wait passively for a valid LCP packet from
# the peer (instead of exiting, as it does without this option).
#passive
# With this option, pppd will not transmit LCP packets to initiate a
# connection until a valid LCP packet is received from the peer (as for
# the "passive" option with old versions of pppd).
#silent
# Don't request or allow negotiation of any options for LCP and IPCP
# (use default values).
#-all
# Disable Address/Control compression negotiation (use default, i.e.
# address/control field disabled).
#-ac
# Disable asyncmap negotiation (use the default asyncmap, i.e. escape
# all control characters).
#-am
# Don't fork to become a background process (otherwise pppd will do so
# if a serial device is specified).
#-detach
# Disable IP address negotiation (with this option, the remote IP
# address must be specified with an option on the command line or in
# an options file).
#-ip
# Disable IPCP negotiation and IP communication. This option should
# only be required if the peer is buggy and gets confused by requests
# from pppd for IPCP negotiation.
#noip
# Disable magic number negotiation. With this option, pppd cannot
# detect a looped-back line.
#-mn
# Disable MRU [Maximum Receive Unit] negotiation (use default, i.e.
# 1500).
#-mru
# Disable protocol field compression negotiation (use default, i.e.
# protocol field compression disabled).
#-pc
# Require the peer to authenticate itself using PAP.
#+pap
# Don't agree to authenticate using PAP.
#-pap
# Require the peer to authenticate itself using CHAP [Cryptographic
# Handshake Authentication Protocol] authentication.
#+chap
# Don't agree to authenticate using CHAP.
#-chap
# Disable negotiation of Van Jacobson style IP header compression (use
# default, i.e. no compression).
#-vj
# Increase debugging level (same as -d). If this option is given, pppd
# will log the contents of all control packets sent or received in a
# readable form. The packets are logged through syslog with facility
# daemon and level debug. This information can be directed to a file by
# setting up /etc/syslog.conf appropriately (see syslog.conf(5)). (If
# pppd is compiled with extra debugging enabled, it will log messages
# using facility local2 instead of daemon).
#debug
# Append the domain name <d> to the local host name for authentication
# purposes. For example, if gethostname() returns the name porsche,
# but the fully qualified domain name is porsche.Quotron.COM, you would
# use the domain option to set the domain name to Quotron.COM.
#domain <d>
# Enable debugging code in the kernel-level PPP driver. The argument n
# is a number which is the sum of the following values: 1 to enable
# general debug messages, 2 to request that the contents of received
# packets be printed, and 4 to request that the contents of transmitted
# packets be printed.
#kdebug n
# Set the MTU [Maximum Transmit Unit] value to <n>. Unless the peer
# requests a smaller value via MRU negotiation, pppd will request that
# the kernel networking code send data packets of no more than n bytes
# through the PPP network interface.
#mtu <n>
# Set the name of the local system for authentication purposes to <n>.
# This is a privileged option. With this option, pppd will use lines in the
# secrets files which have <n> as the second field when looking for a
# secret to use in authenticating the peer. In addition, unless overridden
# with the user option, <n> will be used as the name to send to the peer
# when authenticating the local system to the peer. (Note that pppd does
# not append the domain name to <n>.)
#name <n>
# Enforce the use of the hostname as the name of the local system for
# authentication purposes (overrides the name option).
#usehostname
# Set the assumed name of the remote system for authentication purposes
# to <n>.
#remotename <n>
# Add an entry to this system's ARP [Address Resolution Protocol]
# table with the IP address of the peer and the Ethernet address of this
# system.
#proxyarp
# Use the system password database for authenticating the peer using
# PAP. Note: mgetty already provides this option. If this is specified
# then dialin from users using a script under Linux to fire up ppp wont work.
# login
# If this option is given, pppd will send an LCP echo-request frame to the
# peer every n seconds. Normally the peer should respond to the echo-request
# by sending an echo-reply. This option can be used with the
# lcp-echo-failure option to detect that the peer is no longer connected.
lcp-echo-interval 30
# If this option is given, pppd will presume the peer to be dead if n
# LCP echo-requests are sent without receiving a valid LCP echo-reply.
# If this happens, pppd will terminate the connection. Use of this
# option requires a non-zero value for the lcp-echo-interval parameter.
# This option can be used to enable pppd to terminate after the physical
# connection has been broken (e.g., the modem has hung up) in
# situations where no hardware modem control lines are available.
lcp-echo-failure 4
# Set the LCP restart interval (retransmission timeout) to <n> seconds
# (default 3).
#lcp-restart <n>
# Set the maximum number of LCP terminate-request transmissions to <n>
# (default 3).
#lcp-max-terminate <n>
# Set the maximum number of LCP configure-request transmissions to <n>
# (default 10).
#lcp-max-configure <n>
# Set the maximum number of LCP configure-NAKs returned before starting
# to send configure-Rejects instead to <n> (default 10).
#lcp-max-failure <n>
# Set the IPCP restart interval (retransmission timeout) to <n>
# seconds (default 3).
#ipcp-restart <n>
# Set the maximum number of IPCP terminate-request transmissions to <n>
# (default 3).
#ipcp-max-terminate <n>
# Set the maximum number of IPCP configure-request transmissions to <n>
# (default 10).
#ipcp-max-configure <n>
# Set the maximum number of IPCP configure-NAKs returned before starting
# to send configure-Rejects instead to <n> (default 10).
#ipcp-max-failure <n>
# Set the PAP restart interval (retransmission timeout) to <n> seconds
# (default 3).
#pap-restart <n>
# Set the maximum number of PAP authenticate-request transmissions to
# <n> (default 10).
#pap-max-authreq <n>
# Set the maximum time that pppd will wait for the peer to authenticate
# itself with PAP to <n> seconds (0 means no limit).
#pap-timeout <n>
# Set the CHAP restart interval (retransmission timeout for
# challenges) to <n> seconds (default 3).
#chap-restart <n>
# Set the maximum number of CHAP challenge transmissions to <n>
# (default 10).
#chap-max-challenge
# If this option is given, pppd will rechallenge the peer every <n>
# seconds.
#chap-interval <n>
# With this option, pppd will accept the peer's idea of our local IP
# address, even if the local IP address was specified in an option.
#ipcp-accept-local
# With this option, pppd will accept the peer's idea of its (remote) IP
# address, even if the remote IP address was specified in an option.
#ipcp-accept-remote
# Disable the IPXCP and IPX protocols.
# To let pppd pass IPX packets comment this out --- you'll probably also
# want to install ipxripd, and have the Internal IPX Network option enabled
# in your kernel. /usr/doc/HOWTO/IPX-HOWTO.gz contains more info.
noipx
# Exit once a connection has been made and terminated. This is the default,
# unless the `persist' or `demand' option has been specified.
#nopersist
# Do not exit after a connection is terminated; instead try to reopen
# the connection.
#persist
# Terminate after n consecutive failed connection attempts.
# A value of 0 means no limit. The default value is 10.
#maxfail <n>
# Initiate the link only on demand, i.e. when data traffic is present.
# With this option, the remote IP address must be specified by the user on
# the command line or in an options file. Pppd will initially configure
# the interface and enable it for IP traffic without connecting to the peer.
# When traffic is available, pppd will connect to the peer and perform
# negotiation, authentication, etc. When this is completed, pppd will
# commence passing data packets (i.e., IP packets) across the link.
#demand
# Specifies that pppd should disconnect if the link is idle for <n> seconds.
# The link is idle when no data packets (i.e. IP packets) are being sent or
# received. Note: it is not advisable to use this option with the persist
# option without the demand option. If the active-filter option is given,
# data packets which are rejected by the specified activity filter also
# count as the link being idle.
#idle <n>
# Specifies how many seconds to wait before re-initiating the link after
# it terminates. This option only has any effect if the persist or demand
# option is used. The holdoff period is not applied if the link was
# terminated because it was idle.
#holdoff <n>
# Wait for up n milliseconds after the connect script finishes for a valid
# PPP packet from the peer. At the end of this time, or when a valid PPP
# packet is received from the peer, pppd will commence negotiation by
# sending its first LCP packet. The default value is 1000 (1 second).
# This wait period only applies if the connect or pty option is used.
#connect-delay <n>
# Packet filtering: for more information, see pppd(8)
# Any packets matching the filter expression will be interpreted as link
# activity, and will cause a "demand" connection to be activated, and reset
# the idle connection timer. (idle option)
# The filter expression is akin to that of tcpdump(1)
#active-filter <filter-expression>
# ---<End of File>---

22
debian/extra/options.ttyXX vendored Normal file
View File

@ -0,0 +1,22 @@
# If you need to set up multiple serial lines differently, then copy this
# file to options.<ttyname> for each <ttyname> with a modem on it.
#
# Example:
# options.ttyS1 for the second serial port (a.k.a. COM2)
#
# Edit the following line so that the first IP address mentioned is the
# IP address or name of your host, while the second is the IP address
# or name of the remote machine.
hostname:remotepeername
# 192.168.0.1:192.168.0.2
# You may also put additional settings in each file, just like in the
# general options file. For example:
#
# noauth
# debug
# defaultroute
# mtu 296
#
# Read pppd(8) for more information.

43
debian/extra/pap-secrets vendored Normal file
View File

@ -0,0 +1,43 @@
#
# /etc/ppp/pap-secrets
#
# This is a pap-secrets file to be used with the AUTO_PPP function of
# mgetty. mgetty-0.99 is preconfigured to startup pppd with the login option
# which will cause pppd to consult /etc/passwd (and /etc/shadow in turn)
# after a user has passed this file. Don't be disturbed therefore by the fact
# that this file defines logins with any password for users. /etc/passwd
# (again, /etc/shadow, too) will catch passwd mismatches.
#
# This file should block ALL users that should not be able to do AUTO_PPP.
# AUTO_PPP bypasses the usual login program so it's necessary to list all
# system userids with regular passwords here.
#
# ATTENTION: The definitions here can allow users to login without a
# password if you don't use the login option of pppd! The mgetty Debian
# package already provides this option; make sure you don't change that.
# INBOUND connections
# Every regular user can use PPP and has to use passwords from /etc/passwd
* hostname "" *
# UserIDs that cannot use PPP at all. Check your /etc/passwd and add any
# other accounts that should not be able to use pppd!
guest hostname "*" -
master hostname "*" -
root hostname "*" -
support hostname "*" -
stats hostname "*" -
# OUTBOUND connections
# Here you should add your userid password to connect to your providers via
# PAP. The * means that the password is to be used for ANY host you connect
# to. Thus you do not have to worry about the foreign machine name. Just
# replace password with your password.
# If you have different providers with different passwords then you better
# remove the following line.
#-HOSTNAME- * password

39
debian/extra/peers-gprs vendored Normal file
View File

@ -0,0 +1,39 @@
# example configuration for a GPRS/UMTS/HDSPA connection
#
# See the manual page pppd(8) for information on all the options.
# If your carrier requires authentication, uncomment this directive and
# replace myusername@realm with the login name provided by them.
# If authentication is used, there should be a matching entry with the
# password in /etc/ppp/pap-secrets and/or /etc/ppp/chap-secrets.
#user "myusername@realm"
# MUST CHANGE: replace ******** with the APN name specific to your
# mobile carrier and data plan.
# The /etc/chatscripts/gprs chat script may be modified to change the
# modem initialization string.
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs -T ********"
# Serial device to which the modem is connected.
/dev/modem
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth
# Disable some PPP protocol features which are usually not supported by
# mobile carriers.
novj
novjccomp
noccp
nomagic

32
debian/extra/peers-pppoa vendored Normal file
View File

@ -0,0 +1,32 @@
# example configuration for the kernel space PPP over ATM driver
#
# See the manual page pppd(8) for information on all the options.
# MUST CHANGE: replace myusername@realm with the PPP login name given to
# your by your provider.
# There should be a matching entry with the password in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "myusername@realm"
# Load the PPPoA plugin.
plugin pppoatm.so
# VP.VC pair used by your ISP.
8.35
# Enable this option if your ISP uses PPPoA with LLC encapsulation.
#llc-encaps
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth

29
debian/extra/peers-pppoe vendored Normal file
View File

@ -0,0 +1,29 @@
# example configuration for the kernel space PPP over Ethernet driver
#
# See the manual page pppd(8) for information on all the options.
# MUST CHANGE: replace myusername@realm with the PPP login name given to
# your by your provider.
# There should be a matching entry with the password in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "myusername@realm"
# Load the PPPoE plugin.
plugin rp-pppoe.so
# Ethernet interface to which the modem is connected.
eth0
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth

33
debian/extra/per-linkname vendored Normal file
View File

@ -0,0 +1,33 @@
Date: Mon, 06 Oct 2003 16:00:25 +0200
From: Eyal Rozenberg <rozenbrg@barak-online.net>
Subject: ppp per-linkname script dir
(I'm writing you as the maintainer of the Debian ppp package)
On my system, I sometime find it necessary to run different commands for
different peers/providers after the ppp connection, like specific
complex routing configuration, etc. To do so I have added the files
/etc/ppp/ip-up.d/00peer-specific and /etc/ppp/ip-down.d/00peer-specific
whose contents is:
------------------------------------------------------------------
#!/bin/bash
#
# run peer-specific (or, rather, 'link-name' specific) scripts
if [ -n "$LINKNAME" ] ; then
run-parts /etc/ppp/ip-up.d/$LINKNAME
fi
exit 0
------------------------------------------------------------------
and the same thing for if-down.d (but with its respective directory
name). To use these, one must set the linkname pppd option in the files
under /etc/ppp/peers - but that's a good idea anyway.
Perhaps you would consider adding such files to the ppp package.
Eyal Rozenberg

7
debian/extra/plog vendored Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ -s /var/log/ppp.log ]; then
exec tail "$@" /var/log/ppp.log
else
exec tail "$@" /var/log/syslog | grep ' \(pppd\|chat\)\['
fi

107
debian/extra/poff vendored Normal file
View File

@ -0,0 +1,107 @@
#!/bin/sh
# $Id: poff,v 1.8 1999/08/28 16:34:51 phil Exp $
# Written by John Hasler <john@dhh.gt.org> and based on work
# by Phil Hands <phil@hands.com>. Distributed under the GNU GPL
if [ -x /usr/bin/kill ]; then
KILL="/usr/bin/kill"
else
KILL="/bin/kill"
fi
SIG=TERM
DONE="stopped"
MODE=""
usage ()
{
cat <<!EOF!
usage: $0 [option] [provider]
options:
-r Cause pppd to drop the line and redial.
-d Toggle the state of pppd's debug option.
-c Cause pppd to renegotiate compression.
-a Stop all pppd's. 'provider' will be ignored.
-h Print this help summary and exit.
-v Print version and exit.
none Stop pppd.
Options may not be combined.
If 'provider' is omitted pppd will be stopped or signalled if and only if
there is exactly one running unless the '-a' option was given. If
'provider' is supplied the pppd controlling the connection to that
provider will be stopped or signalled.
!EOF!
}
# Get option. If there are none replace the "?" that getopts puts in
# FLAG on error with "null".
getopts rdcavh FLAG
if [ "$?" -ne 0 ]; then
FLAG="null"
fi
# Check for additional options. Should be none.
getopts :rdcavh DUMMY
if [ "$?" -eq 0 ]; then
echo "$0: Illegal option -- ${OPTARG}."
exit 1
fi
case $FLAG in
"r") SIG=HUP; DONE=signalled; shift ;;
"d") SIG=USR1; DONE=signalled; shift ;;
"c") SIG=USR2; DONE=signalled; shift ;;
"a") MODE="all"; shift ;;
"v") echo "$0$Revision: 1.8 $_TrickToPrint_RCS_Revision"; exit 0 ;;
"h") usage; exit 0 ;;
"?") exit 1;
esac
# Get the PIDs of all the pppds running. Could also get these from
# /var/run, but pppd doesn't create .pid files until ppp is up.
PIDS=$(pidof pppd)
# poff is pointless if pppd isn't running.
if [ -z "$PIDS" ]; then
echo "$0: No pppd is running. None ${DONE}."
exit 1
fi
# Find out how many pppd's are running.
N=$(echo "$PIDS" | wc -w)
# If there are no arguments we can't do anything if there is more than one
# pppd running.
if [ "$#" -eq 0 -a "$N" -gt 1 -a $FLAG != "a" ]; then
echo "$0: More than one pppd running and no "-a" option and
no arguments supplied. Nothing ${DONE}."
exit 1
fi
# If either there are no arguments or '-a' was specified kill all the
# pppd's.
if [ "$#" -eq 0 -o "$MODE" = "all" ]; then
$KILL -$SIG $PIDS || {
echo "$0: $KILL failed. None ${DONE}."
exit 1
}
exit 0
fi
# There is an argument, so kill the pppd started on that provider.
PEER=$(echo $1 | sed -e 's#/#\\/#g')
PID=$(ps -o pid,cmd axw | awk "/^ *[0-9]* *(\/usr\/sbin\/)?pppd call $PEER( |\$)/ {print \$1}")
if [ "$PID" ]; then
$KILL -$SIG $PID || {
echo "$0: $KILL failed. None ${DONE}."
exit 1
}
else
echo "$0: I could not find a pppd process for provider '$1'. None ${DONE}."
exit 1
fi
exit 0

58
debian/extra/pon vendored Normal file
View File

@ -0,0 +1,58 @@
#!/bin/sh
while [ $# -ge 1 ]; do
case "$1" in
--quick|-q)
QUICK=true
shift
;;
-*)
echo "\
Usage: pon [OPTIONS] [provider] [arguments]
-q|--quick pppd hangs up after all ip-up scripts are run
If pon is invoked without arguments, /etc/ppp/ppp_on_boot file will be
run, presuming it exists and is executable. Otherwise, a PPP connection
will be started using settings from /etc/ppp/peers/provider.
If you specify one argument, a PPP connection will be started using
settings from the appropriate file in the /etc/ppp/peers/ directory, and
any additional arguments supplied will be passed as extra arguments to
pppd.
"
exit 0
;;
*)
break
;;
esac
done
if [ ! -r /etc/ppp/peers/ ]; then
echo "Error: only members of the 'dip' group can use this command."
exit 1
fi
if [ "$1" ]; then
PROVIDER=$1
shift
fi
if [ -z "$PROVIDER" ]; then
if [ -x /etc/ppp/ppp_on_boot ]; then
[ "$QUICK" ] && touch /var/run/ppp-quick
exec /etc/ppp/ppp_on_boot
fi
# try the default script
PROVIDER=provider
fi
if [ ! -e "/etc/ppp/peers/$PROVIDER" ]; then
echo "\
The file /etc/ppp/peers/$PROVIDER does not exist. Please create it or use
a command line argument to use another file in the /etc/ppp/peers/ directory."
exit 1
fi
[ "$QUICK" ] && touch /var/run/ppp-quick
exec /usr/sbin/pppd call $PROVIDER "$@"

126
debian/extra/pon.1 vendored Normal file
View File

@ -0,0 +1,126 @@
.\" This manual is published under the GPL.
.\" All guidelines specified in the GPL apply here.
.\" To get an ascii file:
.\" groff -man -Tascii pon.1 > pon.txt
.\"
.TH PON 1 "July 2000" "Debian Project" "Debian PPPD"
.SH NAME
pon, poff, plog \- starts up, shuts down or lists the log of PPP connections
.SH SYNOPSIS
.B pon
[ isp\-name [ options ] ]
.br
.B poff
[ \-r ] [ \-d ] [ \-c ] [ \-a ] [ \-h ] [ isp\-name ]
.br
.B plog
[ arguments ]
.SH DESCRIPTION
This manual page describes the \fBpon\fP, \fBplog\fP and \fBpoff\fP
scripts, which allow users to control PPP connections.
.PP
.SS pon
\fBpon\fP, invoked without arguments, runs the \fI/etc/ppp/ppp_on_boot\fP
file, if it exists and is executable. Otherwise, a PPP connection will be
started using configuration from \fI/etc/ppp/peers/provider\fP.
This is the default behaviour unless an \fBisp\-name\fP argument is given.
.PP
For instance, to use ISP configuration "myisp" run:
.IP
pon myisp
.PP
\fBpon\fP will then use the options file \fI/etc/ppp/peers/myisp\fP.
You can pass additional \fBpppd options\fP after the ISP name, too.
\fBpon\fP can be used to run multiple, simultaneous PPP connections.
.PP
\fBpon\fP takes the following command line options:
.RS
.TP
.B "\-q" "\-\-quick"
disconnect when ip\-up finishes running.
This function is only available to the \fIroot\fP user.
.SS poff
\fBpoff\fP closes a PPP connection. If more than one PPP connection exists,
the one named in the argument to \fBpoff\fP will be killed, e.g.
.IP
poff myprovider2
.PP
will terminate the connection to myprovider2, and leave the PPP connections
to e.g. "myprovider1" or "myprovider3" up and running.
.PP
\fBpoff\fP takes the following command line options:
.RS
.TP
.B "\-r"
causes the connection to be redialed after it is dropped.
.TP
.B "\-d"
toggles the state of pppd's debug option.
.TP
.B "\-c"
causes
.BR pppd (8)
to renegotiate compression.
.TP
.B "\-a"
stops all running ppp connections. If the argument \fBisp\-name\fP
is given it will be ignored.
.TP
.B "\-h"
displays help information.
.TP
.B "\-v"
prints the version and exits.
.PP
If no argument is given, \fBpoff\fP will stop or signal pppd if and only
if there is exactly one running. If more than one connection is active,
it will exit with an error code of 1.
.PP
.SS plog
\fBplog\fP shows you the last few lines of \fI/var/log/ppp.log\fP. If that
file doesn't exist, it shows you the last few lines of your
\fI/var/log/syslog\fP file, but excluding the lines not generated by pppd.
This script makes use of the
.BR tail (1)
command, so arguments that can be passed to
.BR tail (1)
can also be passed to \fBplog\fP.
.PP
Note: the \fBplog\fP script can only be used by root or another system
administrator in group "adm", due to security reasons. Also, to have all
pppd-generated information in one logfile, that plog can show, you need the
following line in your \fI/etc/syslog.conf\fP file:
.PP
local2.* \-/var/log/ppp.log
.RE
.SH FILES
.TP
.I /etc/ppp/options
PPPd system options file.
.TP
.I /etc/ppp/pap\-secrets
System PAP passwords file.
.TP
.I /etc/ppp/chap\-secrets
System CHAP passwords file.
.TP
.I /etc/ppp/peers/
Directory holding the peer options files. The default file is called
\fIprovider\fP.
.TP
.I /etc/chatscripts/provider
The chat script invoked from the default \fI/etc/ppp/peers/provider\fP.
.TP
.I /var/log/ppp.log
The default PPP log file.
.SH AUTHORS
The p-commands were written by Christoph Lameter <clameter@debian.org>.
Updated and revised by Philip Hands <phil@hands.com>.
.br
This manual was written by Othmar Pasteka <othmar@tron.at>. Modified
by Rob Levin <lilo@openprojects.net>, with some extensions taken from
the old p-commands manual written by John Hasler <jhasler@debian.org>.
.SH "SEE ALSO"
.BR pppd (8),
.BR chat (8),
.BR tail (1).

33
debian/extra/popp vendored Normal file
View File

@ -0,0 +1,33 @@
#!/usr/bin/perl -w
#
# popp connects to your provider and returns. You are able to
# see pppd proceed dialing. Once the connection is
# established pppd returns.
#
# Exit Status: taken from pppd
#
# Example: popp && mailsync
#
# This will dial your default provider, you will see pppd
# progress and as soon as the connection's established, your
# mail will get synchronized
#
# Version: 0.1 28-Dec-2001 "Tomas Pospisek" <tpo_deb@sourcepole.ch>
use strict;
my $ret;
my $pid = fork();
unless ($pid) {
# child
exec "plog -f";
} else {
# parent
my $provider = "provider" unless @ARGV;
$ret = system "pon $provider @ARGV updetach";
kill "SIGTERM", $pid;
};
exit $ret / 256; # perlbizzare

86
debian/extra/pppoe-discovery.8 vendored Normal file
View File

@ -0,0 +1,86 @@
.\" pppoe-discovery.8 written by
.\" Ben Hutchings <ben@decadentplace.org.uk>, based on pppoe.8.
.\" Licenced under the GPL version 2 or later.
.TH PPPOE-DISCOVERY 8 "22 January 2006"
.SH NAME
pppoe\-discovery \- perform PPPoE discovery
.SH SYNOPSIS
.B pppoe\-discovery
[
.I options
]
.br
.BR pppoe\-discovery " { " \-V " | " \-h " }"
.SH DESCRIPTION
.LP
\fBpppoe\-discovery\fR performs the same discovery process as
\fBpppoe\fR, but does not initiate a session.
It sends a PADI packet and then prints the names of access
concentrators in each PADO packet it receives.
.SH OPTIONS
.TP
.BI \-I " interface"
.RS
The \fB\-I\fR option specifies the Ethernet interface to use.
Under Linux, it is typically eth0 or eth1.
The interface should be \(lqup\(rq before you start
\fBpppoe\-discovery\fR, but should \fInot\fR be configured to have an
IP address.
The default interface is eth0.
.RE
.TP
.BI \-D " file_name"
.RS
The \fB\-D\fR option causes every packet to be dumped to the specified
\fIfile_name\fR.
This is intended for debugging only.
.RE
.TP
.B \-U
.RS
Causes \fBpppoe\-discovery\fR to use the Host-Uniq tag in its discovery
packets.
This lets you run multiple instances of \fBpppoe\-discovery\fR and/or
\fBpppoe\fR without having their discovery packets interfere with one
another.
You must supply this option to \fIall\fR instances that you intend to
run simultaneously.
.RE
.TP
.BI \-S " service_name"
.RS
Specifies the desired service name.
\fBpppoe\-discovery\fR will only accept access concentrators which can
provide the specified service.
In most cases, you should \fInot\fR specify this option.
Use it only if you know that there are multiple access concentrators
or know that you need a specific service name.
.RE
.TP
.BI \-C " ac_name"
.RS
Specifies the desired access concentrator name.
\fBpppoe\-discovery\fR will only accept the specified access
concentrator.
In most cases, you should \fInot\fR specify this option.
Use it only if you know that there are multiple access concentrators.
If both the \fB\-S\fR and \fB\-C\fR options are specified, they must
\fIboth\fR match.
.RE
.TP
.B \-A
.RS
This option is accepted for compatibility with \fBpppoe\fR, but has no
effect.
.RE
.TP
.BR \-V " | " \-h
.RS
Either of these options causes \fBpppoe\-discovery\fR to print its
version number and usage information, then exit.
.RE
.SH AUTHORS
\fBpppoe\-discovery\fR was written by Marco d'Itri <md@linux.it>,
based on \fBpppoe\fR by David F. Skoll <dfs@roaringpenguin.com>.
.SH SEE ALSO
pppoe(8), pppoe-sniff(8)

19
debian/extra/provider.chatscript vendored Normal file
View File

@ -0,0 +1,19 @@
# This is the chat script used to dial out to your default service provider.
# Please customize the entries enclosed in parenthesis to match your setup.
# Only the "provider" file will be handled by poff and pon (unless with
# extra command line arguments).
#
# Remember to edit /etc/ppp/peers/provider accordingly.
#
# ATZW2 as a default init string
# - On all hayes compatible modems, W2 will correctly report the connect
# speed.
#
ABORT BUSY
ABORT "NO CARRIER"
ABORT VOICE
ABORT "NO DIALTONE"
"" ATZW2
OK ATDT<put phone number here>
ogin <put login name here>
word \q<put password here>

35
debian/extra/provider.peer vendored Normal file
View File

@ -0,0 +1,35 @@
# example configuration for a dialup connection authenticated with PAP or CHAP
#
# This is the default configuration used by pon(1) and poff(1).
# See the manual page pppd(8) for information on all the options.
# MUST CHANGE: replace myusername@realm with the PPP login name given to
# your by your provider.
# There should be a matching entry with the password in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "myusername@realm"
# MUST CHANGE: replace ******** with the phone number of your provider.
# The /etc/chatscripts/pap chat script may be modified to change the
# modem initialization string.
connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********"
# Serial device to which the modem is connected.
/dev/modem
# Speed of the serial line.
115200
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth

13
debian/extra/udeb/ip-up vendored Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
# adds the DNS servers got via ppp to the global resolv.conf
# License: GPL
# Copyright Eddy Petrișor <eddy.petrisor@gmail.com> 2006
umask 0022 # normally ran by pppd with 0077
: >> /etc/resolv.conf
MARK='added by D-I (pppd)'
cp /etc/resolv.conf /tmp/resolv.conf.tmp
sed "/#$MARK/d" /tmp/resolv.conf.tmp > /etc/resolv.conf
rm -f /tmp/resolv.conf.tmp
[ "$DNS1" ] && echo "nameserver $DNS1 #$MARK" >> /etc/resolv.conf
[ "$DNS2" ] && echo "nameserver $DNS2 #$MARK" >> /etc/resolv.conf

8
debian/extra/udeb/options vendored Normal file
View File

@ -0,0 +1,8 @@
asyncmap 0
auth
crtscts
lock
hide-password
modem
lcp-echo-interval 30
lcp-echo-failure 4

16
debian/extra/udeb/post-base-installer.d/30ppp vendored Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh -e
# Configure ppp for the target system
# Note: netcfg takes care of general networking configuration files
# We can only do this after ppp has been installed to ensure correct permissions
apt-install ppp || true
if [ ! -d /target/etc/ppp/peers ]; then
logger -t ppp-udeb "Error: directory /target/etc/ppp/peers does not exist"
logger -t ppp-udeb "There may have been an error installing ppp"
exit 1
fi
# We copy over already existing files, so permissions are preserved
cp /etc/ppp/*-secrets /target/etc/ppp/
cp /etc/ppp/peers/provider /target/etc/ppp/peers/

7
debian/extra/userscripts-down vendored Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh -e
getent passwd | awk -F: '{print $1 " " $6}' | \
while read user home; do
[ -x $home/.ip-up.d/ ] && su $user run-parts $home/.ip-up.d/
done

7
debian/extra/userscripts-up vendored Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh -e
getent passwd | awk -F: '{print $1 " " $6}' | \
while read user home; do
[ -x $home/.ip-up.d/ ] && su $user run-parts $home/.ip-up.d/
done

17
debian/gen_substvars_dev vendored Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
if [ $# -ne 2 ]; then
echo "Usage: $0 <upstream> <abi>" >&2
exit 1
fi
UPSTREAM=$1
ABI=$2
ABI_NEXT=$(($ABI + 1))
PKG="ppp"
cat <<EOF
${PKG}:Depends=${PKG} (>= ${UPSTREAM}-${ABI}+~), ${PKG} (<< ${UPSTREAM}-${ABI_NEXT}~)
${PKG}:Breaks=${PKG} (<< ${UPSTREAM}-${ABI}+~), ${PKG} (>= ${UPSTREAM}-${ABI_NEXT}~)
${PKG}:PluginDir=/usr/lib/pppd/${UPSTREAM}
EOF

View File

@ -0,0 +1,48 @@
From 5e90783d11a59268e05f4cfb29ce2343b13e8ab2 Mon Sep 17 00:00:00 2001
From: Martin von Gagern <Martin.vGagern@gmx.net>
Date: Sat, 9 Aug 2014 22:44:45 -0400
Subject: [PATCH 01/16] abort on errors in subdir builds
The current recursive loops do not check the exit status of make
in subdirs which leads to `make` passing even when a subdir failed
to compile or install.
URL: https://bugs.gentoo.org/334727
Signed-off-by: Martin von Gagern <Martin.vGagern@gmx.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
pppd/plugins/Makefile.linux | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
index ab8cf50d9472..8a90e393a057 100644
--- a/pppd/plugins/Makefile.linux
+++ b/pppd/plugins/Makefile.linux
@@ -27,7 +27,7 @@ include .depend
endif
all: $(PLUGINS)
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done
%.so: %.c
$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
@@ -37,12 +37,12 @@ VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
install: $(PLUGINS)
$(INSTALL) -d $(LIBDIR)
$(INSTALL) $? $(LIBDIR)
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install; done
+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install || exit $$?; done
clean:
rm -f *.o *.so *.a
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean || exit $$?; done
depend:
$(CPP) -M $(CFLAGS) *.c >.depend
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done
+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend || exit $$?; done
--
2.15.1

View File

@ -0,0 +1,165 @@
From 35e5a569c988b1ff865b02a24d9a727a00db4da9 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 3 Jun 2014 08:53:47 +0000
Subject: [PATCH 02/16] pppd: add support for defaultroute-metric option
This allows user to specify the 'metric' (or 'prio') for the default
route set by pppd. This is useful in multi-ISP setups where there
might be more than one default gateway.
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
pppd/options.c | 5 +++++
pppd/pppd.8 | 6 ++++++
pppd/sys-linux.c | 28 +++++++++++++++++++---------
3 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/pppd/options.c b/pppd/options.c
index 45fa742cd9ce..ca3f8750c8bb 100644
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -121,6 +121,7 @@ bool dryrun; /* print out option values and exit */
char *domain; /* domain name set by domain option */
int child_wait = 5; /* # seconds to wait for children at exit */
struct userenv *userenv_list; /* user environment variables */
+int dfl_route_metric = -1; /* metric of the default route to set over the PPP link */
#ifdef MAXOCTETS
unsigned int maxoctets = 0; /* default - no limit */
@@ -299,6 +300,10 @@ option_t general_options[] = {
"Unset user environment variable",
OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
+ { "defaultroute-metric", o_int, &dfl_route_metric,
+ "Metric to use for the default route (Linux only; -1 for default behavior)",
+ OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 },
+
#ifdef HAVE_MULTILINK
{ "multilink", o_bool, &multilink,
"Enable multilink operation", OPT_PRIO | 1 },
diff --git a/pppd/pppd.8 b/pppd/pppd.8
index e2768b135273..c508d277df3a 100644
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -121,6 +121,12 @@ the gateway, when IPCP negotiation is successfully completed.
This entry is removed when the PPP connection is broken. This option
is privileged if the \fInodefaultroute\fR option has been specified.
.TP
+.B defaultroute-metric
+Define the metric of the \fIdefaultroute\fR and only add it if there
+is no other default route with the same metric. With the default
+value of -1, the route is only added if there is no default route at
+all.
+.TP
.B disconnect \fIscript
Execute the command specified by \fIscript\fR, by passing it to a
shell, after
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index 72a7727c403f..37bdda4d7818 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -232,7 +232,7 @@ static int baud_rate_of (int speed);
static void close_route_table (void);
static int open_route_table (void);
static int read_route_table (struct rtentry *rt);
-static int defaultroute_exists (struct rtentry *rt);
+static int defaultroute_exists (struct rtentry *rt, int metric);
static int get_ether_addr (u_int32_t ipaddr, struct sockaddr *hwaddr,
char *name, int namelen);
static void decode_version (char *buf, int *version, int *mod, int *patch);
@@ -242,6 +242,8 @@ static int make_ppp_unit(void);
extern u_char inpacket_buf[]; /* borrowed from main.c */
+extern int dfl_route_metric;
+
/*
* SET_SA_FAMILY - set the sa_family field of a struct sockaddr,
* if it exists.
@@ -1439,7 +1441,7 @@ static char *path_to_procfs(const char *tail)
FILE *route_fd = (FILE *) 0;
static char route_buffer[512];
static int route_dev_col, route_dest_col, route_gw_col;
-static int route_flags_col, route_mask_col;
+static int route_flags_col, route_metric_col, route_mask_col;
static int route_num_cols;
static int open_route_table (void);
@@ -1482,6 +1484,7 @@ static int open_route_table (void)
route_dest_col = 1;
route_gw_col = 2;
route_flags_col = 3;
+ route_metric_col = 6;
route_mask_col = 7;
route_num_cols = 8;
@@ -1542,6 +1545,7 @@ static int read_route_table(struct rtentry *rt)
SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
rt->rt_flags = (short) strtoul(cols[route_flags_col], NULL, 16);
+ rt->rt_metric = (short) strtoul(cols[route_metric_col], NULL, 10);
rt->rt_dev = cols[route_dev_col];
return 1;
@@ -1550,9 +1554,10 @@ static int read_route_table(struct rtentry *rt)
/********************************************************************
*
* defaultroute_exists - determine if there is a default route
+ * with the given metric (or negative for any)
*/
-static int defaultroute_exists (struct rtentry *rt)
+static int defaultroute_exists (struct rtentry *rt, int metric)
{
int result = 0;
@@ -1565,7 +1570,8 @@ static int defaultroute_exists (struct rtentry *rt)
if (kernel_version > KVERSION(2,1,0) && SIN_ADDR(rt->rt_genmask) != 0)
continue;
- if (SIN_ADDR(rt->rt_dst) == 0L) {
+ if (SIN_ADDR(rt->rt_dst) == 0L && (metric < 0
+ || rt->rt_metric == metric)) {
result = 1;
break;
}
@@ -1612,13 +1618,13 @@ int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
{
struct rtentry rt;
- if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
+ if (defaultroute_exists(&rt, dfl_route_metric) && strcmp(rt.rt_dev, ifname) != 0) {
if (rt.rt_flags & RTF_GATEWAY)
- error("not replacing existing default route via %I",
- SIN_ADDR(rt.rt_gateway));
+ error("not replacing existing default route via %I with metric %d",
+ SIN_ADDR(rt.rt_gateway), dfl_route_metric);
else
- error("not replacing existing default route through %s",
- rt.rt_dev);
+ error("not replacing existing default route through %s with metric %d",
+ rt.rt_dev, dfl_route_metric);
return 0;
}
@@ -1626,6 +1632,7 @@ int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
SET_SA_FAMILY (rt.rt_dst, AF_INET);
rt.rt_dev = ifname;
+ rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
if (kernel_version > KVERSION(2,1,0)) {
SET_SA_FAMILY (rt.rt_genmask, AF_INET);
@@ -1660,6 +1667,9 @@ int cifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
rt.rt_dev = ifname;
+ rt.rt_dev = ifname;
+ rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
+
if (kernel_version > KVERSION(2,1,0)) {
SET_SA_FAMILY (rt.rt_genmask, AF_INET);
SIN_ADDR(rt.rt_genmask) = 0L;
--
2.15.1

View File

@ -0,0 +1,29 @@
From 67811a647d399db5d188a242827760615a0f86b5 Mon Sep 17 00:00:00 2001
From: radaiming <radaiming@gmail.com>
Date: Sat, 13 Dec 2014 14:42:34 +0800
Subject: [PATCH 03/16] scripts: Avoid killing wrong pppd
poff could kill other pppd processes when there are many pppd
running on different serial port.
Signed-off-by: Ming Dai <radaiming@gmail.com>
---
scripts/poff | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/poff b/scripts/poff
index 3f55a7f40010..5b45d98a2b6a 100644
--- a/scripts/poff
+++ b/scripts/poff
@@ -91,7 +91,7 @@ if test "$#" -eq 0 -o "$MODE" = "all" ; then
fi
# There is an argument, so kill the pppd started on that provider.
-PID=`ps axw | grep "[ /]pppd call $1" | awk '{print $1}'`
+PID=`ps axw | grep "[ /]pppd call $1" | grep -w "$1" | awk '{print $1}'`
if test -n "$PID" ; then
$KILL -$SIG $PID || {
echo "$0: $KILL failed. None ${DONE}."
--
2.15.1

View File

@ -0,0 +1,30 @@
From 5e8c3cb256a7e86e3572a82a75d51c6850efdbdc Mon Sep 17 00:00:00 2001
From: "Philip A. Prindeville" <philipp@redfish-solutions.com>
Date: Fri, 19 Dec 2014 17:52:58 -0700
Subject: [PATCH 04/16] pppd: Fix sign-extension when displaying bytes in octal
print_string() displays characters as \\%.03o but without first
casting it from "char" to "unsigned char" so it gets sign-extended
to an int. This causes output like \37777777630 instead of \230.
Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com>
---
pppd/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/utils.c b/pppd/utils.c
index 29bf970905d5..3ac1b60926d2 100644
--- a/pppd/utils.c
+++ b/pppd/utils.c
@@ -625,7 +625,7 @@ print_string(p, len, printer, arg)
printer(arg, "\\t");
break;
default:
- printer(arg, "\\%.3o", c);
+ printer(arg, "\\%.3o", (unsigned char) c);
}
}
}
--
2.15.1

View File

@ -0,0 +1,33 @@
From 219aac3b53d0827549377f1bfe22853ee52d4405 Mon Sep 17 00:00:00 2001
From: Simon Farnsworth <simon@farnz.org.uk>
Date: Sun, 1 Mar 2015 11:49:06 +0000
Subject: [PATCH 05/16] Suppress false error message on PPPoE disconnect
Once the kernel handles PPPoE PADTs correctly[1], a PADT triggered
disconnect will result in EALREADY when pppd tries to clear the session ID.
Simply ignore the error if, and only if, the error is EALREADY
[1] https://patchwork.ozlabs.org/patch/444717/
Signed-off-by: Simon Farnsworth <simon@farnz.org.uk>
---
pppd/plugins/rp-pppoe/plugin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
index a8c2bb4f4a6a..da50cdf2b9d3 100644
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
@@ -270,7 +270,7 @@ PPPOEDisconnectDevice(void)
memcpy(sp.sa_addr.pppoe.dev, conn->ifName, IFNAMSIZ);
memcpy(sp.sa_addr.pppoe.remote, conn->peerEth, ETH_ALEN);
if (connect(conn->sessionSocket, (struct sockaddr *) &sp,
- sizeof(struct sockaddr_pppox)) < 0)
+ sizeof(struct sockaddr_pppox)) < 0 && errno != EALREADY)
error("Failed to disconnect PPPoE socket: %d %m", errno);
close(conn->sessionSocket);
/* don't send PADT?? */
--
2.15.1

View File

@ -0,0 +1,31 @@
From cd2c14f998c57bbe6a01dc5854f2763c0d7f31fb Mon Sep 17 00:00:00 2001
From: Simon Farnsworth <simon@farnz.org.uk>
Date: Sun, 1 Mar 2015 11:53:58 +0000
Subject: [PATCH 06/16] Send PADT on PPPoE disconnect
Once we've terminated the PPP session, there is no chance of a PPP layer
disconnect. Some PPPoE relays don't detect the PPP session going down, and
depend on a long timeout or a PPPoE PADT to terminate the session.
Send a PADT on disconnect to work around these buggy relays.
Signed-off-by: Simon Farnsworth <simon@farnz.org.uk>
---
pppd/plugins/rp-pppoe/plugin.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
@@ -273,9 +273,10 @@
sizeof(struct sockaddr_pppox)) < 0 && errno != EALREADY)
error("Failed to disconnect PPPoE socket: %d %m", errno);
close(conn->sessionSocket);
- /* don't send PADT?? */
- if (conn->discoverySocket >= 0)
+ if (conn->discoverySocket >= 0) {
+ sendPADT(conn, NULL);
close(conn->discoverySocket);
+ }
}
static void

View File

@ -0,0 +1,31 @@
From fe149de624f96629a7f46732055d8f718c74b856 Mon Sep 17 00:00:00 2001
From: Paul Mackerras <paulus@samba.org>
Date: Fri, 14 Aug 2015 17:56:26 +1000
Subject: [PATCH 07/16] pppd: ipxcp: Prevent buffer overrun on remote router
name
This fixes an if condition to prevent a possible 1-byte overrun
on ipxcp_hisoptions[0].name.
Reported-by: "Sabas Rosales, Blanca E" <blanca.e.sabas.rosales@intel.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
---
pppd/ipxcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/ipxcp.c b/pppd/ipxcp.c
index 7b2343e15537..aaff10f76200 100644
--- a/pppd/ipxcp.c
+++ b/pppd/ipxcp.c
@@ -1194,7 +1194,7 @@ ipxcp_reqci(f, inp, len, reject_if_disagree)
case IPX_ROUTER_NAME:
if (cilen >= CILEN_NAME) {
int name_size = cilen - CILEN_NAME;
- if (name_size > sizeof (ho->name))
+ if (name_size >= sizeof (ho->name))
name_size = sizeof (ho->name) - 1;
memset (ho->name, 0, sizeof (ho->name));
memcpy (ho->name, p, name_size);
--
2.15.1

View File

@ -0,0 +1,30 @@
From 234edab99a6bb250cc9ecd384cca27b0c8b475ce Mon Sep 17 00:00:00 2001
From: Sylvain Rochet <gradator@gradator.net>
Date: Wed, 25 Mar 2015 00:25:18 +0100
Subject: [PATCH 08/16] pppd: Fix ccp_options.mppe type
This corrects the type of ccp_options.mppe; it is actually a bitfield of
MPPE_OPT_* and not a boolean.
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
pppd/ccp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/ccp.h b/pppd/ccp.h
index 6f4a2fee0a2c..76446db007c0 100644
--- a/pppd/ccp.h
+++ b/pppd/ccp.h
@@ -37,7 +37,7 @@ typedef struct ccp_options {
bool predictor_2; /* do Predictor-2? */
bool deflate_correct; /* use correct code for deflate? */
bool deflate_draft; /* use draft RFC code for deflate? */
- bool mppe; /* do MPPE? */
+ u_char mppe; /* MPPE bitfield */
u_short bsd_bits; /* # bits/code for BSD Compress */
u_short deflate_size; /* lg(window size) for Deflate */
short method; /* code for chosen compression method */
--
2.15.1

View File

@ -0,0 +1,33 @@
From 094cb8ae4c61db225e67fedadb4964f846dd0c27 Mon Sep 17 00:00:00 2001
From: Sylvain Rochet <gradator@gradator.net>
Date: Tue, 24 Mar 2015 21:21:40 +0100
Subject: [PATCH 09/16] pppd: Fix ccp_cilen calculated size if both
deflate_correct and deflate_draft are enabled
This fixes a bug where ccp_cilen() will return 4 bytes less than
necessary for the addci buffer if both deflate_correct and
deflate_draft are enabled.
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
pppd/ccp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pppd/ccp.c b/pppd/ccp.c
index 5814f358eb44..7d7922afcfc0 100644
--- a/pppd/ccp.c
+++ b/pppd/ccp.c
@@ -676,7 +676,8 @@ ccp_cilen(f)
ccp_options *go = &ccp_gotoptions[f->unit];
return (go->bsd_compress? CILEN_BSD_COMPRESS: 0)
- + (go->deflate? CILEN_DEFLATE: 0)
+ + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0)
+ + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0)
+ (go->predictor_1? CILEN_PREDICTOR_1: 0)
+ (go->predictor_2? CILEN_PREDICTOR_2: 0)
+ (go->mppe? CILEN_MPPE: 0);
--
2.15.1

View File

@ -0,0 +1,25 @@
From f831f27c309fb2f4dfca3336a9f144993e02c225 Mon Sep 17 00:00:00 2001
From: YASUOKA Masahiko <yasuoka@yasuoka.net>
Date: Wed, 16 Mar 2016 13:39:19 +0900
Subject: [PATCH 10/16] Fix a typo in comment. Diff from Yuuichi Someya.
---
pppd/fsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/fsm.c b/pppd/fsm.c
index c200cc3a8438..e9bd34f0e8f4 100644
--- a/pppd/fsm.c
+++ b/pppd/fsm.c
@@ -468,7 +468,7 @@ fsm_rconfreq(f, id, inp, len)
f->nakloops = 0;
} else {
- /* we sent CONFACK or CONFREJ */
+ /* we sent CONFNAK or CONFREJ */
if (f->state != ACKRCVD)
f->state = REQSENT;
if( code == CONFNAK )
--
2.15.1

View File

@ -0,0 +1,24 @@
From 2ecc3c7ce01d01e514c8a514b16c45aec1d5613f Mon Sep 17 00:00:00 2001
From: Dmitry Deshevoy <mityada@gmail.com>
Date: Thu, 31 Mar 2016 23:39:32 +0400
Subject: [PATCH 11/16] plog: count only relevant lines from syslog
Closes paulusmack/ppp#42
---
scripts/plog | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/plog b/scripts/plog
index 84d2c7340cc6..7cb53346413d 100644
--- a/scripts/plog
+++ b/scripts/plog
@@ -3,5 +3,5 @@
if [ -s /var/log/ppp.log ]; then
exec tail "$@" /var/log/ppp.log
else
- exec tail "$@" /var/log/syslog | grep ' \(pppd\|chat\)\['
+ exec grep ' \(pppd\|chat\)\[' /var/log/syslog | tail "$@"
fi
--
2.15.1

View File

@ -0,0 +1,33 @@
From 56a4760236ee0a606075404c5704801feffa646c Mon Sep 17 00:00:00 2001
From: Stefan Nickl <Stefan.Nickl@gmail.com>
Date: Wed, 10 Aug 2016 21:32:21 +0200
Subject: [PATCH 12/16] Change include from sys/errno.h to errno.h
According to POSIX, the canonical location for errno.h is on the top level.
Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com>
---
pppd/sys-linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index b4a435d2a993..20b42ac3e80c 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -73,12 +73,12 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
-#include <sys/errno.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <sys/sysmacros.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
--
2.15.1

View File

@ -0,0 +1,214 @@
From bbcdc4366bbee6c3f4e1ddda31e4eec8c1b3ccc2 Mon Sep 17 00:00:00 2001
From: Paul Mackerras <paulus@samba.org>
Date: Tue, 23 Aug 2016 16:10:21 +1000
Subject: [PATCH 13/16] pppd: allow use of arbitrary interface names
This is a modified version of a patch from openSUSE that enables PPP interfaces
to be called arbitrary names, rather than simply pppX where X is the unit
number.
The modifications from the stock openSUSE patch are:
- refresh patch on top of 018_ip-up_option.diff
- fix a printf format-string vulnerability in pppd/main.c:set_ifunit()
- clarify the pppd.8 manpage additions
- patch pppstats/pppstats.c to query renamed interfaces without complaint
Origin: SUSE
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458646
Forwarded: no
Reviewed-by: Chris Boot <bootc@debian.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
---
pppd/main.c | 16 ++++++----------
pppd/options.c | 5 +++++
pppd/pppd.8 | 8 +++++++-
pppd/pppd.h | 11 +++++++++++
pppd/sys-linux.c | 15 +++++++++++++++
pppstats/pppstats.c | 12 ++++++------
6 files changed, 50 insertions(+), 17 deletions(-)
diff --git a/pppd/main.c b/pppd/main.c
index 6d50d1bac1d9..f1986ed68d0b 100644
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -124,7 +124,7 @@
static const char rcsid[] = RCSID;
/* interface vars */
-char ifname[32]; /* Interface name */
+char ifname[MAXIFNAMELEN]; /* Interface name */
int ifunit; /* Interface unit number */
struct channel *the_channel;
@@ -298,13 +298,6 @@ struct protent *protocols[] = {
NULL
};
-/*
- * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
- */
-#if !defined(PPP_DRV_NAME)
-#define PPP_DRV_NAME "ppp"
-#endif /* !defined(PPP_DRV_NAME) */
-
int
main(argc, argv)
int argc;
@@ -737,8 +730,11 @@ void
set_ifunit(iskey)
int iskey;
{
- info("Using interface %s%d", PPP_DRV_NAME, ifunit);
- slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+ if (req_ifname[0] != '\0')
+ slprintf(ifname, sizeof(ifname), "%s", req_ifname);
+ else
+ slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+ info("Using interface %s", ifname);
script_setenv("IFNAME", ifname, iskey);
if (iskey) {
create_pidfile(getpid()); /* write pid to file */
diff --git a/pppd/options.c b/pppd/options.c
index c06a2b4ad8ed..177488ca6813 100644
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -114,6 +114,7 @@ char linkname[MAXPATHLEN]; /* logical name for link */
bool tune_kernel; /* may alter kernel settings */
int connect_delay = 1000; /* wait this many ms after connect script */
int req_unit = -1; /* requested interface unit */
+char req_ifname[MAXIFNAMELEN]; /* requested interface name */
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
bool dump_options; /* print out option values */
@@ -284,6 +285,10 @@ option_t general_options[] = {
"PPP interface unit number to use if possible",
OPT_PRIO | OPT_LLIMIT, 0, 0 },
+ { "ifname", o_string, req_ifname,
+ "Set PPP interface name",
+ OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXIFNAMELEN },
+
{ "dump", o_bool, &dump_options,
"Print out option values after parsing all options", 1 },
{ "dryrun", o_bool, &dryrun,
diff --git a/pppd/pppd.8 b/pppd/pppd.8
index c508d277df3a..06e945fce998 100644
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -1079,7 +1079,13 @@ under Linux and FreeBSD 2.2.8 and later.
.TP
.B unit \fInum
Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
-connections.
+connections. If the unit is already in use a dynamically allocated number will
+be used.
+.TP
+.B ifname \fIstring
+Set the ppp interface name for outbound connections. If the interface name is
+already in use, or if the name cannot be used for any other reason, pppd will
+terminate.
.TP
.B unset \fIname
Remove a variable from the environment variable for scripts that are
diff --git a/pppd/pppd.h b/pppd/pppd.h
index 247fa153739b..1a1bf0b99582 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -80,6 +80,16 @@
#define MAXARGS 1 /* max # args to a command */
#define MAXNAMELEN 256 /* max length of hostname or name for auth */
#define MAXSECRETLEN 256 /* max length of password or secret */
+#define MAXIFNAMELEN 32 /* max length of interface name; or use IFNAMSIZ, can we
+ always include net/if.h? */
+
+/*
+ * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
+ * Where should PPP_DRV_NAME come from? Do we include it here?
+ */
+#if !defined(PPP_DRV_NAME)
+#define PPP_DRV_NAME "ppp"
+#endif /* !defined(PPP_DRV_NAME) */
/*
* Option descriptor structure.
@@ -318,6 +328,7 @@ extern bool tune_kernel; /* May alter kernel settings as necessary */
extern int connect_delay; /* Time to delay after connect script */
extern int max_data_rate; /* max bytes/sec through charshunt */
extern int req_unit; /* interface unit number to use */
+extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
extern bool multilink; /* enable multilink operation */
extern bool noendpoint; /* don't send or accept endpt. discrim. */
extern char *bundle_name; /* bundle name for multilink */
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index b4a435d2a993..b832031f7e26 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -643,6 +643,21 @@ static int make_ppp_unit()
}
if (x < 0)
error("Couldn't create new ppp unit: %m");
+
+ if (x == 0 && req_ifname[0] != '\0') {
+ struct ifreq ifr;
+ char t[MAXIFNAMELEN];
+ memset(&ifr, 0, sizeof(struct ifreq));
+ slprintf(t, sizeof(t), "%s%d", PPP_DRV_NAME, ifunit);
+ strncpy(ifr.ifr_name, t, IF_NAMESIZE);
+ strncpy(ifr.ifr_newname, req_ifname, IF_NAMESIZE);
+ x = ioctl(sock_fd, SIOCSIFNAME, &ifr);
+ if (x < 0)
+ error("Couldn't rename interface %s to %s: %m", t, req_ifname);
+ else
+ info("Renamed interface %s to %s", t, req_ifname);
+ }
+
return x;
}
diff --git a/pppstats/pppstats.c b/pppstats/pppstats.c
index 6367988eb96b..46cb9c24942b 100644
--- a/pppstats/pppstats.c
+++ b/pppstats/pppstats.c
@@ -88,7 +88,6 @@ int aflag; /* print absolute values, not deltas */
int dflag; /* print data rates, not bytes */
int interval, count;
int infinite;
-int unit;
int s; /* socket or /dev/ppp file descriptor */
int signalled; /* set if alarm goes off "early" */
char *progname;
@@ -449,6 +448,7 @@ main(argc, argv)
{
int c;
#ifdef STREAMS
+ int unit;
char *dev;
#endif
@@ -506,11 +506,6 @@ main(argc, argv)
if (argc > 0)
interface = argv[0];
- if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
- fprintf(stderr, "%s: invalid interface '%s' specified\n",
- progname, interface);
- }
-
#ifndef STREAMS
{
struct ifreq ifr;
@@ -535,6 +530,11 @@ main(argc, argv)
}
#else /* STREAMS */
+ if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
+ fprintf(stderr, "%s: invalid interface '%s' specified\n",
+ progname, interface);
+ }
+
#ifdef __osf__
dev = "/dev/streams/ppp";
#else
--
2.15.1

View File

@ -0,0 +1,25 @@
From 66ae569f1c6fb12df8a463c8beb9afc0c7e5f7f0 Mon Sep 17 00:00:00 2001
From: George Burgess IV <george@gbiv.net>
Date: Fri, 9 Sep 2016 17:36:54 -0700
Subject: [PATCH 14/16] pppd: Remove unused declaration of ttyname.
Signed-off-by: George Burgess IV <george@gbiv.net>
---
pppd/main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/pppd/main.c b/pppd/main.c
index 6d50d1bac1d9..aef9e8477592 100644
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -257,7 +257,6 @@ static void cleanup_db __P((void));
static void handle_events __P((void));
void print_link_stats __P((void));
-extern char *ttyname __P((int));
extern char *getlogin __P((void));
int main __P((int, char *[]));
--
2.15.1

View File

@ -0,0 +1,52 @@
From b7b97dea6eb042fae0dfaca39cbb190411e5fd31 Mon Sep 17 00:00:00 2001
From: Stefan Nickl <Stefan.Nickl@gmail.com>
Date: Wed, 10 Aug 2016 16:52:12 +0200
Subject: [PATCH 15/16] pppd: Provide error() implementation in pppoe-discovery
The pppoe-discovery program calls error() from the CHECK_ROOM macro
defined in pppoe.h. Since pppoe-discovery is a standalone program not
linked with the rest of pppd, the only way this could build is by
linking to glibc's proprietary error(3) function instead of the function
of the same name (but with different arguments) defined in pppd/utils.c.
So with glibc this builds, but will probably crash when the assertion is
triggered. As the assertion is unlikely to fail, nobody has noticed.
The build however fails with musl libc or uClibc since they don't
provide the doppelganger.
Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com>
---
pppd/plugins/rp-pppoe/pppoe-discovery.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
index 3d3bf4eecc81..55037dffb023 100644
--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
@@ -9,6 +9,7 @@
*
*/
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -55,6 +56,14 @@ void die(int status)
exit(status);
}
+void error(char *fmt, ...)
+{
+ va_list pvar;
+ va_start(pvar, fmt);
+ vfprintf(stderr, fmt, pvar);
+ va_end(pvar);
+}
+
/* Initialize frame types to RFC 2516 values. Some broken peers apparently
use different frame types... sigh... */
--
2.15.1

View File

@ -0,0 +1,49 @@
From 50a2997b256e0e0ef7a46fae133f56f60fce539c Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 9 Jan 2017 13:34:23 +0000
Subject: [PATCH 16/16] pppoe: include netinet/in.h before linux/in.h
This fixes builds with newer kernels. Basically, <netinet/in.h> needs to be
included before <linux/in.h> otherwise the earlier, unaware of the latter,
tries to redefine symbols and structures. Also, <linux/if_pppox.h> doesn't work
alone anymore, since it pulls the headers in the wrong order, so we better
include <netinet/in.h> early.
---
pppd/plugins/rp-pppoe/pppoe.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
index 9ab2eee3914c..c4aaa6e68856 100644
--- a/pppd/plugins/rp-pppoe/pppoe.h
+++ b/pppd/plugins/rp-pppoe/pppoe.h
@@ -47,6 +47,10 @@
#include <sys/socket.h>
#endif
+/* This has to be included before Linux 4.8's linux/in.h
+ * gets dragged in. */
+#include <netinet/in.h>
+
/* Ugly header files on some Linux boxes... */
#if defined(HAVE_LINUX_IF_H)
#include <linux/if.h>
@@ -84,8 +88,6 @@ typedef unsigned long UINT32_t;
#include <linux/if_ether.h>
#endif
-#include <netinet/in.h>
-
#ifdef HAVE_NETINET_IF_ETHER_H
#include <sys/types.h>
@@ -98,7 +100,6 @@ typedef unsigned long UINT32_t;
#endif
-
/* Ethernet frame types according to RFC 2516 */
#define ETH_PPPOE_DISCOVERY 0x8863
#define ETH_PPPOE_SESSION 0x8864
--
2.15.1

20
debian/patches/010_scripts_README.diff vendored Normal file
View File

@ -0,0 +1,20 @@
--- ppp-2.4.0b4.orig/scripts/README
+++ ppp-2.4.0b4/scripts/README
@@ -141,3 +141,17 @@
are escaped. This may need to be modified depending on the ssh (or
pseudo-tty) implementation which may differ across platforms, for further
optimizations.
+
+------------------------------------------------------------------------
+
+12. pon, poff and ip-up
+
+These are modified version of the pon/poff/ip-up scripts contributed by Yann
+Dirson <dirson@debian.org>. They allow you to call "pon quick" respectively
+"pon quick my-isp" to just call the provider for running you ip-up scripts in
+/etc/ppp/ip-up.d. This can be useful to check for incoming/flush outgoing
+mail, without the necessary delay before hangup introduced by diald or such.
+
+These scripts break the possibility to connect to multiple ISPs at once, so
+they are included only here.
+

152
debian/patches/011_scripts_redialer.diff vendored Normal file
View File

@ -0,0 +1,152 @@
--- ppp-2.4.0b4.orig/scripts/redialer
+++ ppp-2.4.0b4/scripts/redialer
@@ -1,96 +1,69 @@
#!/bin/sh
-###################################################################
#
-# These parameters control the attack dialing sequence.
+# A chatscript that will attempt to dial multiple numbers in sequence, until
+# you get connected.
#
-# Maximum number of attempts to reach the telephone number(s)
-MAX_ATTEMPTS=10
-
-# Delay between each of the attempts. This is a parameter to sleep
-# so use "15s" for 15 seconds, "1m" for 1 minute, etc.
-SLEEP_DELAY=15s
-
-###################################################################
+# To use: edit /etc/peers/provider, and change the connect line to read:
+# connect "/usr/local/bin/redialer"
#
-# This is a list of telephone numbers. Add new numbers if you wish
-# and see the function 'callall' below for the dial process.
-PHONE1=555-1212
-PHONE2=411
+# See below for configuration.
-###################################################################
+# This is a list of chatscripts to use to get connected, and (optional)
+# telephone numbers to call for each of those chatscripts.
#
-# If you use the ppp-on script, then these are passed to this routine
-# automatically. There is no need to define them here. If not, then
-# you will need to set the values.
-#
-ACCOUNT=my_account_name
-PASSWORD=my_password
+# Note that in the chatscripts, you may use #NUMBER#, this will be replaced
+# with the number it is calling. You might want to use this to only have one
+# chatscript that is used for all numbers, or you might need multiple
+# chatscripts.
-###################################################################
-#
-# Function to initialize the modem and ensure that it is in command
-# state. This may not be needed, but it doesn't hurt.
-#
-function initialize
-{
- chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK'
- return
-}
+PHONE1=123456789
+CHAT1=/etc/chatscripts/provider
-###################################################################
-#
-# Script to dial a telephone
-#
-function callnumber
-{
-chat -v \
- ABORT '\nBUSY\r' \
- ABORT '\nNO ANSWER\r' \
- ABORT '\nRINGING\r\n\r\nRINGING\r' \
- '' ATDT$1 \
- CONNECT '' \
- ogin:--ogin: $ACCOUNT \
- assword: $PASSWORD
-#
-# If the connection was successful then end the whole script with a
-# success.
-#
- if [ "$?" = "0" ]; then
- exit 0
- fi
+PHONE2=912345678
+CHAT2=/etc/chatscripts/provider
- return
-}
+PHONE3=891234567
+CHAT3=/etc/chatscripts/provider
-###################################################################
-#
-# Script to dial any telephone number
-#
-function callall
-{
-# echo "dialing attempt number: $1" >/dev/console
- callnumber $PHONE1
-# callnumber $PHONE2
-}
+PHONE4=789123456
+CHAT4=/etc/chatscripts/provider
-###################################################################
-#
-# Initialize the modem to ensure that it is in the command state
-#
-initialize
-if [ ! "$?" = "0" ]; then
- exit 1
-fi
+PHONE5=001234567
+CHAT5=/etc/chatscripts/provider
+# How long to sleep between retries:
#
-# Dial telephone numbers until one answers
-#
+# Note that this is a parameter to sleep so use "15s" for 15 seconds,
+# "1m" for 1 minute, etc
+SLEEP_DELAY=1s
+
+# The code below does the dialing.
+
attempt=0
while : ; do
- attempt=`expr $attempt + 1`
- callall $attempt
- if [ "$attempt" = "$MAX_ATTEMPTS" ]; then
- exit 1
- fi
- sleep "$SLEEP_DELAY"
+ attempt=`expr $attempt + 1`
+ NUMBER=`eval echo '$PHONE'$attempt`
+ CHAT=`eval echo '$CHAT'$attempt`
+ if [ ! "$CHAT" ]; then
+ attempt=0
+ else
+ logger "Dialing attempt number: $attempt"
+ sed s/#NUMBER#/$NUMBER/ $CHAT >/etc/chatscripts/tmpchat
+ /usr/sbin/chat -v -f /etc/chatscripts/tmpchat
+ rm -f /etc/chatscripts/tmpchat
+ case $? in
+ 0) logger Connection established ; exit 0;;
+ 1) logger chat: exit 1, see manpage for details. ; exit 1;;
+ 2) logger chat: exit 2, see manpage for details. ; exit 2;;
+ 3) logger chat: exit 3, see manpage for details. ;;
+ 4) logger Line busy. ;;
+ 5) logger No Carrier. ;;
+ 6) logger A call is coming. Exiting! ; exit 1;;
+ 7) logger No dialtone. ;;
+ 8) logger An error occured. Exiting! ; exit 1;;
+ *) logger chat: exit $?, see manpage for details. ;;
+ esac
+ logger "Waiting $SLEEP_DELAY seconds before next try."
+ sleep $SLEEP_DELAY
+ fi
done

84
debian/patches/018_ip-up_option.diff vendored Normal file
View File

@ -0,0 +1,84 @@
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -1984,7 +1984,7 @@
*/
if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
ipcp_script_state = s_up;
- ipcp_script(_PATH_IPUP, 0);
+ ipcp_script(path_ipup, 0);
}
}
@@ -2034,7 +2034,7 @@
/* Execute the ip-down script */
if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
ipcp_script_state = s_down;
- ipcp_script(_PATH_IPDOWN, 0);
+ ipcp_script(path_ipdown, 0);
}
}
@@ -2097,13 +2097,13 @@
case s_up:
if (ipcp_fsm[0].state != OPENED) {
ipcp_script_state = s_down;
- ipcp_script(_PATH_IPDOWN, 0);
+ ipcp_script(path_ipdown, 0);
}
break;
case s_down:
if (ipcp_fsm[0].state == OPENED) {
ipcp_script_state = s_up;
- ipcp_script(_PATH_IPUP, 0);
+ ipcp_script(path_ipup, 0);
}
break;
}
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -308,6 +308,9 @@
struct protent *protp;
char numbuf[16];
+ strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
+ strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
+
link_stats_valid = 0;
new_phase(PHASE_INITIALIZE);
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -114,6 +114,8 @@
bool tune_kernel; /* may alter kernel settings */
int connect_delay = 1000; /* wait this many ms after connect script */
int req_unit = -1; /* requested interface unit */
+char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
@@ -304,6 +306,13 @@
"Unset user environment variable",
OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
+ { "ip-up-script", o_string, path_ipup,
+ "Set pathname of ip-up script",
+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
+ { "ip-down-script", o_string, path_ipdown,
+ "Set pathname of ip-down script",
+ OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
+
#ifdef HAVE_MULTILINK
{ "multilink", o_bool, &multilink,
"Enable multilink operation", OPT_PRIO | 1 },
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -328,6 +328,8 @@
extern int connect_delay; /* Time to delay after connect script */
extern int max_data_rate; /* max bytes/sec through charshunt */
extern int req_unit; /* interface unit number to use */
+extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
extern bool multilink; /* enable multilink operation */
extern bool noendpoint; /* don't send or accept endpt. discrim. */

35
debian/patches/CVE-2020-8597.patch vendored Normal file
View File

@ -0,0 +1,35 @@
From 8d7970b8f3db727fe798b65f3377fe6787575426 Mon Sep 17 00:00:00 2001
From: Paul Mackerras <paulus@ozlabs.org>
Date: Mon, 3 Feb 2020 15:53:28 +1100
Subject: [PATCH] pppd: Fix bounds check in EAP code
Given that we have just checked vallen < len, it can never be the case
that vallen >= len + sizeof(rhostname). This fixes the check so we
actually avoid overflowing the rhostname array.
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
---
pppd/eap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/pppd/eap.c
+++ b/pppd/eap.c
@@ -1661,7 +1661,7 @@ int len;
}
/* Not so likely to happen. */
- if (vallen >= len + sizeof (rhostname)) {
+ if (len - vallen >= sizeof (rhostname)) {
dbglog("EAP: trimming really long peer name down");
BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1);
rhostname[sizeof (rhostname) - 1] = '\0';
@@ -2251,7 +2251,7 @@ int len;
}
/* Not so likely to happen. */
- if (vallen >= len + sizeof (rhostname)) {
+ if (len - vallen >= sizeof (rhostname)) {
dbglog("EAP: trimming really long peer name down");
BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1);
rhostname[sizeof (rhostname) - 1] = '\0';

56
debian/patches/adaptive_echos vendored Normal file
View File

@ -0,0 +1,56 @@
--- a/pppd/lcp.c
+++ b/pppd/lcp.c
@@ -73,6 +73,7 @@ static void lcp_delayed_up __P((void *))
*/
int lcp_echo_interval = 0; /* Interval between LCP echo-requests */
int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */
+bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */
bool lax_recv = 0; /* accept control chars in asyncmap */
bool noendpoint = 0; /* don't send/accept endpoint discriminator */
@@ -151,6 +152,8 @@ static option_t lcp_option_list[] = {
OPT_PRIO },
{ "lcp-echo-interval", o_int, &lcp_echo_interval,
"Set time in seconds between LCP echo requests", OPT_PRIO },
+ { "lcp-echo-adaptive", o_bool, &lcp_echo_adaptive,
+ "Suppress LCP echo requests if traffic was received", 1 },
{ "lcp-restart", o_int, &lcp_fsm[0].timeouttime,
"Set time in seconds between LCP retransmissions", OPT_PRIO },
{ "lcp-max-terminate", o_int, &lcp_fsm[0].maxtermtransmits,
@@ -2331,6 +2334,22 @@ LcpSendEchoRequest (f)
}
}
+ /*
+ * If adaptive echos have been enabled, only send the echo request if
+ * no traffic was received since the last one.
+ */
+ if (lcp_echo_adaptive) {
+ static unsigned int last_pkts_in = 0;
+
+ update_link_stats(f->unit);
+ link_stats_valid = 0;
+
+ if (link_stats.pkts_in != last_pkts_in) {
+ last_pkts_in = link_stats.pkts_in;
+ return;
+ }
+ }
+
/*
* Make and send the echo request frame.
*/
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -557,6 +557,11 @@ to 1) if the \fIproxyarp\fR option is us
dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to
1) in demand mode if the local address changes.
.TP
+.B lcp\-echo\-adaptive
+If this option is used with the \fIlcp\-echo\-failure\fR option then
+pppd will send LCP echo\-request frames only if no traffic was received
+from the peer since the last echo\-request was sent.
+.TP
.B lcp\-echo\-failure \fIn
If this option is given, pppd will presume the peer to be dead
if \fIn\fR LCP echo\-requests are sent without receiving a valid LCP

23
debian/patches/chat_man vendored Normal file
View File

@ -0,0 +1,23 @@
chat(8): document the TIMEOUT directive
--- ppp-2.4.4.orig/chat/chat.8 2006-12-16 12:56:11.000000000 +0100
+++ ppp-2.4.4/chat/chat.8 2006-12-16 13:49:44.000000000 +0100
@@ -35,7 +35,8 @@
is not received within the time limit then the reply string is not
sent. An alternate reply may be sent or the script will fail if there
is no alternate reply string. A failed script will cause the
-\fIchat\fR program to terminate with a non-zero error code.
+\fIchat\fR program to terminate with a non-zero error code. You can
+also use the TIMEOUT string in order to specify the timeout.
.TP
.B \-r \fI<report file>
Set the file for output of the report strings. If you use the keyword
@@ -348,7 +349,7 @@
.LP
.SH TIMEOUT
The initial timeout value is 45 seconds. This may be changed using the \fB\-t\fR
-parameter.
+parameter. You can also specify "TIMEOUT 0".
.LP
To change the timeout value for the next expect string, the following
example may be used:

300
debian/patches/cifdefroute.dif vendored Normal file
View File

@ -0,0 +1,300 @@
Description: Add replacedefaultroute option
Adds an option to pppd to control whether to replace existing default routes
when using the 'defaultroute' option.
If defaultroute and replacedefaultroute are both set, pppd replaces an existing
default route with the new default route. The old default route is restored when
the connection is taken down.
Origin: vendor, https://build.opensuse.org/source/network/ppp/ppp-2.4.2-cifdefroute.diff?rev=7a0fdeff0b29437dd7f4581c95c7255a
Forwarded: no
Reviewed-by: Chris Boot <bootc@debian.org>
Last-Update: 2014-01-26
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -198,6 +198,16 @@
"disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
&ipcp_wantoptions[0].default_route },
+#ifdef __linux__
+ { "replacedefaultroute", o_bool,
+ &ipcp_wantoptions[0].replace_default_route,
+ "Replace default route", 1
+ },
+ { "noreplacedefaultroute", o_bool,
+ &ipcp_allowoptions[0].replace_default_route,
+ "Never replace default route", OPT_A2COPY,
+ &ipcp_wantoptions[0].replace_default_route },
+#endif
{ "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
"Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
{ "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
@@ -271,7 +281,7 @@
ip_active_pkt
};
-static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t));
+static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool));
static void ipcp_script __P((char *, int)); /* Run an up/down script */
static void ipcp_script_done __P((void *));
@@ -1761,7 +1771,12 @@
if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
return 0;
if (wo->default_route)
+#ifndef __linux__
if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
+#else
+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
+ wo->replace_default_route))
+#endif
default_route_set[u] = 1;
if (wo->proxy_arp)
if (sifproxyarp(u, wo->hisaddr))
@@ -1849,7 +1864,8 @@
*/
if (demand) {
if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
- ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr);
+ ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr,
+ wo->replace_default_route);
if (go->ouraddr != wo->ouraddr) {
warn("Local IP address changed to %I", go->ouraddr);
script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0);
@@ -1874,7 +1890,12 @@
/* assign a default route through the interface if required */
if (ipcp_wantoptions[f->unit].default_route)
+#ifndef __linux__
if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
+#else
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
+ wo->replace_default_route))
+#endif
default_route_set[f->unit] = 1;
/* Make a proxy ARP entry if requested. */
@@ -1924,7 +1945,12 @@
/* assign a default route through the interface if required */
if (ipcp_wantoptions[f->unit].default_route)
+#ifndef __linux__
if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
+#else
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
+ wo->replace_default_route))
+#endif
default_route_set[f->unit] = 1;
/* Make a proxy ARP entry if requested. */
@@ -2002,7 +2028,7 @@
sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
sifdown(f->unit);
ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
- ipcp_hisoptions[f->unit].hisaddr);
+ ipcp_hisoptions[f->unit].hisaddr, 0);
}
/* Execute the ip-down script */
@@ -2018,16 +2044,25 @@
* proxy arp entries, etc.
*/
static void
-ipcp_clear_addrs(unit, ouraddr, hisaddr)
+ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute)
int unit;
u_int32_t ouraddr; /* local address */
u_int32_t hisaddr; /* remote address */
+ bool replacedefaultroute;
{
if (proxy_arp_set[unit]) {
cifproxyarp(unit, hisaddr);
proxy_arp_set[unit] = 0;
}
- if (default_route_set[unit]) {
+ /* If replacedefaultroute, sifdefaultroute will be called soon
+ * with replacedefaultroute set and that will overwrite the current
+ * default route. This is the case only when doing demand, otherwise
+ * during demand, this cifdefaultroute would restore the old default
+ * route which is not what we want in this case. In the non-demand
+ * case, we'll delete the default route and restore the old if there
+ * is one saved by an sifdefaultroute with replacedefaultroute.
+ */
+ if (!replacedefaultroute && default_route_set[unit]) {
cifdefaultroute(unit, ouraddr, hisaddr);
default_route_set[unit] = 0;
}
--- a/pppd/ipcp.h
+++ b/pppd/ipcp.h
@@ -70,6 +70,7 @@
bool old_addrs; /* Use old (IP-Addresses) option? */
bool req_addr; /* Ask peer to send IP address? */
bool default_route; /* Assign default route through interface? */
+ bool replace_default_route; /* Replace default route through interface? */
bool proxy_arp; /* Make proxy ARP entry for peer? */
bool neg_vj; /* Van Jacobson Compression? */
bool old_vj; /* use old (short) form of VJ option? */
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -121,6 +121,11 @@
This entry is removed when the PPP connection is broken. This option
is privileged if the \fInodefaultroute\fR option has been specified.
.TP
+.B replacedefaultroute
+This option is a flag to the defaultroute option. If defaultroute is
+set and this flag is also set, pppd replaces an existing default route
+with the new default route.
+.TP
.B disconnect \fIscript
Execute the command specified by \fIscript\fR, by passing it to a
shell, after
@@ -739,7 +744,12 @@
.TP
.B nodefaultroute
Disable the \fIdefaultroute\fR option. The system administrator who
-wishes to prevent users from creating default routes with pppd
+wishes to prevent users from adding a default route with pppd
+can do so by placing this option in the /etc/ppp/options file.
+.TP
+.B noreplacedefaultroute
+Disable the \fIreplacedefaultroute\fR option. The system administrator who
+wishes to prevent users from replacing a default route with pppd
can do so by placing this option in the /etc/ppp/options file.
.TP
.B nodeflate
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -664,7 +664,11 @@
int cif6addr __P((int, eui64_t, eui64_t));
/* Remove an IPv6 address from i/f */
#endif
+#ifndef __linux__
int sifdefaultroute __P((int, u_int32_t, u_int32_t));
+#else
+int sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
+#endif
/* Create default route through i/f */
int cifdefaultroute __P((int, u_int32_t, u_int32_t));
/* Delete default route through i/f */
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -207,6 +207,8 @@
static int if_is_up; /* Interface has been marked up */
static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */
static int have_default_route; /* Gateway for default route added */
+static struct rtentry old_def_rt; /* Old default route */
+static int default_rt_repl_rest; /* replace and restore old default rt */
static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */
static char proxy_arp_dev[16]; /* Device for proxy arp entry */
static u_int32_t our_old_addr; /* for detecting address changes */
@@ -1549,6 +1551,9 @@
p = NULL;
}
+ SET_SA_FAMILY (rt->rt_dst, AF_INET);
+ SET_SA_FAMILY (rt->rt_gateway, AF_INET);
+
SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
@@ -1618,22 +1623,53 @@
/********************************************************************
*
* sifdefaultroute - assign a default route through the address given.
- */
-
-int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
-{
- struct rtentry rt;
-
- if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
- if (rt.rt_flags & RTF_GATEWAY)
- error("not replacing existing default route via %I",
- SIN_ADDR(rt.rt_gateway));
- else
- error("not replacing existing default route through %s",
- rt.rt_dev);
- return 0;
+ *
+ * If the global default_rt_repl_rest flag is set, then this function
+ * already replaced the original system defaultroute with some other
+ * route and it should just replace the current defaultroute with
+ * another one, without saving the current route. Use: demand mode,
+ * when pppd sets first a defaultroute it it's temporary ppp0 addresses
+ * and then changes the temporary addresses to the addresses for the real
+ * ppp connection when it has come up.
+ */
+
+int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace)
+{
+ struct rtentry rt, tmp_rt;
+ struct rtentry *del_rt = NULL;
+
+ if (default_rt_repl_rest) {
+ /* We have already reclaced the original defaultroute, if we
+ * are called again, we will delete the current default route
+ * and set the new default route in this function.
+ * - this is normally only the case the doing demand: */
+ if (defaultroute_exists( &tmp_rt ))
+ del_rt = &tmp_rt;
+ } else if ( defaultroute_exists( &old_def_rt ) &&
+ strcmp( old_def_rt.rt_dev, ifname ) != 0) {
+ /* We did not yet replace an existing default route, let's
+ * check if we should save and replace a default route:
+ */
+ u_int32_t old_gateway = SIN_ADDR(old_def_rt.rt_gateway);
+
+ if (old_gateway != gateway) {
+ if (!replace) {
+ error("not replacing default route to %s [%I]",
+ old_def_rt.rt_dev, old_gateway);
+ return 0;
+ } else {
+ // we need to copy rt_dev because we need it permanent too:
+ char * tmp_dev = malloc(strlen(old_def_rt.rt_dev)+1);
+ strcpy(tmp_dev, old_def_rt.rt_dev);
+ old_def_rt.rt_dev = tmp_dev;
+
+ notice("replacing old default route to %s [%I]",
+ old_def_rt.rt_dev, old_gateway);
+ default_rt_repl_rest = 1;
+ del_rt = &old_def_rt;
+ }
+ }
}
-
memset (&rt, 0, sizeof (rt));
SET_SA_FAMILY (rt.rt_dst, AF_INET);
@@ -1650,6 +1686,12 @@
error("default route ioctl(SIOCADDRT): %m");
return 0;
}
+ if (default_rt_repl_rest && del_rt)
+ if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
+ if ( ! ok_error ( errno ))
+ error("del old default route ioctl(SIOCDELRT): %m(%d)", errno);
+ return 0;
+ }
have_default_route = 1;
return 1;
@@ -1685,6 +1727,16 @@
return 0;
}
}
+ if (default_rt_repl_rest) {
+ notice("restoring old default route to %s [%I]",
+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
+ if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
+ if ( ! ok_error ( errno ))
+ error("restore default route ioctl(SIOCADDRT): %m(%d)", errno);
+ return 0;
+ }
+ default_rt_repl_rest = 0;
+ }
return 1;
}

35
debian/patches/close_dev_ppp vendored Normal file
View File

@ -0,0 +1,35 @@
be sure to close /dev/ppp when reconnecting
From: Simon Peter <dn.tlp@gmx.net>
Subject: Bug#306261: pppd does not properly close /dev/ppp on persist
When using the kernel PPPoE driver, pppd never
closes /dev/ppp when the link has come down.
It opens superfluous fds to the device each time it re-opens the
connection, with the unclosed ones falsely reported always ready for
data by select().
This makes pppd eat up 100% CPU time after the first persist because of
the always instantly returning select() on the unclosed fds.
The problem also occurs with the upstream version, but does not occur
when a pty/tty device is used for the ppp connection.
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -453,6 +453,13 @@ int generic_establish_ppp (int fd)
if (new_style_driver) {
int flags;
+ /* if a ppp_fd is already open, close it first */
+ if(ppp_fd > 0) {
+ close(ppp_fd);
+ remove_fd(ppp_fd);
+ ppp_fd = -1;
+ }
+
/* Open an instance of /dev/ppp and connect the channel to it */
if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
error("Couldn't get channel number: %m");

3298
debian/patches/eaptls-mppe.patch vendored Normal file

File diff suppressed because it is too large Load Diff

39
debian/patches/fix_linkpidfile vendored Normal file
View File

@ -0,0 +1,39 @@
make sure that the linkpidfile is always created
Subject: Bug#284382: ppp: linkpidfile is not created upon detachment
From: <herbert@gondor.apana.org.au>
Package: ppp
Version: 2.4.2+20040428-2
Severity: wishlist
When pppd detaches from the parent normally, that is, without nodetach
or updetach set, the linkpidfile is not created even when linkname is
set.
This is because the create_linkpidfile call in detach() is only made
if the linkpidfile is filled in. However, linkpidfile is never filled
in until create_linkpidfile has been called.
IMHO the call should be made uncondtionally in detach() since
create_linkpidfile does its own check on linkname anyway.
Please note that the version of pppd in woody always wrote the
linkpidfile after detaching. It did so in main() however. That
call has now been removed which is why I'm seeing this problem.
[...]
--
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -770,8 +770,7 @@ detach()
/* update pid files if they have been written already */
if (pidfilename[0])
create_pidfile(pid);
- if (linkpidfile[0])
- create_linkpidfile(pid);
+ create_linkpidfile(pid);
exit(0); /* parent dies */
}
setsid();

107
debian/patches/glibc-2.28.patch vendored Normal file
View File

@ -0,0 +1,107 @@
From 3c7b86229f7bd2600d74db14b1fe5b3896be3875 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
Date: Fri, 6 Apr 2018 14:27:18 +0200
Subject: [PATCH] pppd: Use openssl for the DES instead of the libcrypt / glibc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[https://github.com/paulusmack/ppp/commit/3c7b86229f7bd2600d74db14b1fe5b3896be3875]
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>
---
pppd/Makefile.linux | 7 ++++---
pppd/pppcrypt.c | 18 +++++++++---------
2 files changed, 13 insertions(+), 12 deletions(-)
--- ppp-2.4.7.orig/pppd/Makefile.linux
+++ ppp-2.4.7/pppd/Makefile.linux
@@ -35,10 +35,10 @@ endif
COPTS = -O2 -pipe -Wall -g
LIBS = -lcrypto
-# Uncomment the next 2 lines to include support for Microsoft's
+# Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
CHAPMS=y
-USE_CRYPT=y
+#USE_CRYPT=y
# Don't use MSLANMAN unless you really know what you're doing.
#MSLANMAN=y
# Uncomment the next line to include support for MPPE. CHAPMS (above) must
@@ -142,7 +142,8 @@ endif
ifdef NEEDDES
ifndef USE_CRYPT
-LIBS += -ldes $(LIBS)
+CFLAGS += -I/usr/include/openssl
+LIBS += -lcrypto
else
CFLAGS += -DUSE_CRYPT=1
endif
--- ppp-2.4.7.orig/pppd/pppcrypt.c
+++ ppp-2.4.7/pppd/pppcrypt.c
@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w
des_key[7] = Get7Bits(key, 49);
#ifndef USE_CRYPT
- des_set_odd_parity((des_cblock *)des_key);
+ DES_set_odd_parity((DES_cblock *)des_key);
#endif
}
@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */
}
#else /* USE_CRYPT */
-static des_key_schedule key_schedule;
+static DES_key_schedule key_schedule;
bool
DesSetkey(key)
u_char *key;
{
- des_cblock des_key;
+ DES_cblock des_key;
MakeKey(key, des_key);
- des_set_key(&des_key, key_schedule);
+ DES_set_key(&des_key, &key_schedule);
return (1);
}
bool
-DesEncrypt(clear, key, cipher)
+DesEncrypt(clear, cipher)
u_char *clear; /* IN 8 octets */
u_char *cipher; /* OUT 8 octets */
{
- des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher,
- key_schedule, 1);
+ DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
+ &key_schedule, 1);
return (1);
}
@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear)
u_char *cipher; /* IN 8 octets */
u_char *clear; /* OUT 8 octets */
{
- des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear,
- key_schedule, 0);
+ DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
+ &key_schedule, 0);
return (1);
}

54
debian/patches/ipv6-accept-remote vendored Normal file
View File

@ -0,0 +1,54 @@
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
@@ -234,6 +234,8 @@ static option_t ipv6cp_option_list[] = {
{ "ipv6cp-accept-local", o_bool, &ipv6cp_allowoptions[0].accept_local,
"Accept peer's interface identifier for us", 1 },
+ { "ipv6cp-accept-remote", o_bool, &ipv6cp_allowoptions[0].accept_remote,
+ "Accept peer's interface identifier for itself", 1 },
{ "ipv6cp-use-ipaddr", o_bool, &ipv6cp_allowoptions[0].use_ip,
"Use (default) IPv4 address as interface identifier", 1 },
@@ -426,6 +428,7 @@ ipv6cp_init(unit)
memset(ao, 0, sizeof(*ao));
wo->accept_local = 1;
+ wo->accept_remote = 1;
wo->neg_ifaceid = 1;
ao->neg_ifaceid = 1;
@@ -951,7 +954,7 @@ ipv6cp_reqci(f, inp, len, reject_if_disa
orc = CONFREJ; /* Reject CI */
break;
}
- if (!eui64_iszero(wo->hisid) &&
+ if (!eui64_iszero(wo->hisid) && !wo->accept_remote &&
!eui64_equals(ifaceid, wo->hisid) &&
eui64_iszero(go->hisid)) {
--- a/pppd/ipv6cp.h
+++ b/pppd/ipv6cp.h
@@ -150,7 +150,8 @@
typedef struct ipv6cp_options {
int neg_ifaceid; /* Negotiate interface identifier? */
int req_ifaceid; /* Ask peer to send interface identifier? */
- int accept_local; /* accept peer's value for iface id? */
+ int accept_local; /* accept peer's value for our iface id? */
+ int accept_remote; /* accept peer's value for his iface id? */
int opt_local; /* ourtoken set by option */
int opt_remote; /* histoken set by option */
int use_ip; /* use IP as interface identifier */
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -462,6 +462,11 @@ With this option, pppd will accept the p
interface identifier, even if the local IPv6 interface identifier
was specified in an option.
.TP
+.B ipv6cp\-accept\-remote
+With this option, pppd will accept the peer's idea of its (remote)
+IPv6 interface identifier, even if the remote IPv6 interface
+identifier was specified in an option.
+.TP
.B ipv6cp\-max\-configure \fIn
Set the maximum number of IPv6CP configure-request transmissions to
\fIn\fR (default 10).

View File

@ -0,0 +1,68 @@
From 053fa32a9ccd0ac1fbbda50db7aff7fdae18652a Mon Sep 17 00:00:00 2001
From: Alexander Sack <asac@jwsdot.com>
Date: Thu, 18 Dec 2008 05:33:13 +0100
Subject: [PATCH] port: ppp-2.4.4rel/debian/patches/load_ppp_generic_if_needed
---
pppd/sys-linux.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
Index: ppp-2.4.7-2+4ubuntu1/pppd/sys-linux.c
===================================================================
--- ppp-2.4.7-2+4ubuntu1.orig/pppd/sys-linux.c
+++ ppp-2.4.7-2+4ubuntu1/pppd/sys-linux.c
@@ -92,6 +92,7 @@
#include <ctype.h>
#include <termios.h>
#include <unistd.h>
+#include <wait.h>
/* This is in netdevice.h. However, this compile will fail miserably if
you attempt to include netdevice.h because it has so many references
@@ -2126,6 +2127,46 @@
if (kernel_version >= KVERSION(2,3,13)) {
error("Couldn't open the /dev/ppp device: %m");
+ char modprobePath[PATH_MAX] = "";
+ int status, p, count;
+ pid_t pid;
+
+ fd = open("/proc/sys/kernel/modprobe", O_RDONLY);
+ if (fd >= 0) {
+ int count = read(fd, modprobePath, PATH_MAX - 1);
+ if (count < 1)
+ modprobePath[0] = 0;
+ else if (modprobePath[count - 1] == '\n')
+ modprobePath[count - 1] = 0;
+ close(fd);
+ }
+
+ if (modprobePath[0] == 0)
+ strcpy(modprobePath, "/sbin/modprobe");
+
+ switch (pid = fork()) {
+ case 0: /* child */
+ setenv("PATH", "/sbin", 1);
+ status = execl(modprobePath, "modprobe", "ppp_generic", NULL);
+ case -1: /* couldn't fork */
+ errno = ENOENT;
+ default: /* parent */
+ do
+ p = waitpid(pid, &status, 0);
+ while (p == -1 && count++ < 4);
+
+ sleep (5);
+
+ }
+
+ if ((fd = open("/dev/ppp", O_RDWR)) >= 0) {
+ new_style_driver = 1;
+ driver_version = 2;
+ driver_modification = 4;
+ driver_patch = 0;
+ close(fd);
+ return 1;
+ }
if (errno == ENOENT)
no_ppp_msg =
"You need to create the /dev/ppp device node by\n"

260
debian/patches/makefiles_cleanup vendored Normal file
View File

@ -0,0 +1,260 @@
Makefiles cleanup
Factor-out $COPTS and $LDOPTS to allow distributions to easily override
them. Properly use $LDFLAGS when linking and $CFLAGS when compiling.
Do not strip the installed binaries: this should be done by the
packaging system if required.
--- a/chat/Makefile.linux
+++ b/chat/Makefile.linux
@@ -12,20 +12,21 @@
COPTS= -O2 -g -pipe
CFLAGS= $(COPTS) $(CDEFS)
+LDFLAGS=$(LDOPTS)
INSTALL= install
all: chat
chat: chat.o
- $(CC) -o chat chat.o
+ $(CC) $(LDFLAGS) -o chat chat.o
chat.o: chat.c
$(CC) -c $(CFLAGS) -o chat.o chat.c
install: chat
mkdir -p $(BINDIR) $(MANDIR)
- $(INSTALL) -s -c chat $(BINDIR)
+ $(INSTALL) -c chat $(BINDIR)
$(INSTALL) -c -m 644 chat.8 $(MANDIR)
clean:
--- a/pppd/plugins/Makefile.linux
+++ b/pppd/plugins/Makefile.linux
@@ -1,7 +1,7 @@
#CC = gcc
COPTS = -O2 -g
CFLAGS = $(COPTS) -I.. -I../../include -fPIC
-LDFLAGS = -shared
+LDFLAGS = $(LDOPTS)
INSTALL = install
DESTDIR = $(INSTROOT)@DESTDIR@
@@ -30,7 +30,7 @@
for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done
%.so: %.c
- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
+ $(CC) -o $@ $(LDFLAGS) -shared $(CFLAGS) $^
VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
--- a/pppd/plugins/pppoatm/Makefile.linux
+++ b/pppd/plugins/pppoatm/Makefile.linux
@@ -1,7 +1,7 @@
#CC = gcc
COPTS = -O2 -g
CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC
-LDFLAGS = -shared
+LDFLAGS = $(LDOPTS)
INSTALL = install
#***********************************************************************
@@ -33,7 +33,7 @@
all: $(PLUGIN)
$(PLUGIN): $(PLUGIN_OBJS)
- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
+ $(CC) $(LDFLAGS) -o $@ -shared $^ $(LIBS)
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
--- a/pppd/plugins/pppol2tp/Makefile.linux
+++ b/pppd/plugins/pppol2tp/Makefile.linux
@@ -1,7 +1,7 @@
#CC = gcc
COPTS = -O2 -g
CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC
-LDFLAGS = -shared
+LDFLAGS = $(LDOPTS)
INSTALL = install
#***********************************************************************
@@ -16,7 +16,7 @@
all: $(PLUGINS)
%.so: %.o
- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
+ $(CC) $(LDFLAGS) -o $@ -shared $^ $(LIBS)
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
--- a/pppd/plugins/radius/Makefile.linux
+++ b/pppd/plugins/radius/Makefile.linux
@@ -12,7 +12,9 @@
INSTALL = install
PLUGIN=radius.so radattr.so radrealms.so
-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+COPTS=-g -O2
+CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+LDFLAGS= $(LDOPTS)
# Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol.
@@ -36,20 +38,20 @@
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
+ $(INSTALL) -c -m 755 radius.so $(LIBDIR)
+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
$(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
radius.so: radius.o libradiusclient.a
- $(CC) -o radius.so -shared radius.o libradiusclient.a
+ $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
radattr.so: radattr.o
- $(CC) -o radattr.so -shared radattr.o
+ $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o
radrealms.so: radrealms.o
- $(CC) -o radrealms.so -shared radrealms.o
+ $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o
CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
clientid.o sendserver.o lock.o util.o md5.o
--- a/pppd/plugins/rp-pppoe/Makefile.linux
+++ b/pppd/plugins/rp-pppoe/Makefile.linux
@@ -27,10 +27,12 @@
COPTS=-O2 -g
CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"'
+LDFLAGS=$(LDOPTS)
+
all: rp-pppoe.so pppoe-discovery
pppoe-discovery: pppoe-discovery.o debug.o
- $(CC) -o pppoe-discovery pppoe-discovery.o debug.o
+ $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
pppoe-discovery.o: pppoe-discovery.c
$(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
@@ -39,13 +41,13 @@
$(CC) $(CFLAGS) -c -o debug.o debug.c
rp-pppoe.so: plugin.o discovery.o if.o common.o
- $(CC) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
+ $(CC) $(LDFLAGS) -o rp-pppoe.so -shared $^
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
$(INSTALL) -d -m 755 $(BINDIR)
- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
+ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
clean:
rm -f *.o *.so pppoe-discovery
--- a/pppstats/Makefile.linux
+++ b/pppstats/Makefile.linux
@@ -10,23 +10,24 @@
PPPSTATOBJS = pppstats.o
#CC = gcc
-COPTS = -O
+COPTS = -O2 -g
COMPILE_FLAGS = -I../include
LIBS =
INSTALL= install
CFLAGS = $(COPTS) $(COMPILE_FLAGS)
+LDFLAGS= $(LDOPTS)
all: pppstats
install: pppstats
-mkdir -p $(MANDIR)
- $(INSTALL) -s -c pppstats $(BINDIR)
+ $(INSTALL) -c pppstats $(BINDIR)
$(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
pppstats: $(PPPSTATSRCS)
- $(CC) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
+ $(CC) $(LDFLAGS) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
clean:
rm -f pppstats *~ #* core
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
@@ -2,7 +2,10 @@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
-CFLAGS= -O -I../include/net
+COPTS=-O2 -g
+CFLAGS= $(COPTS) -I../include/net
+LDFLAGS=$(LDOPTS)
+
OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
INSTALL= install
@@ -10,12 +13,12 @@
all: pppdump
pppdump: $(OBJS)
- $(CC) -o pppdump $(OBJS)
+ $(CC) $(LDFLAGS) -o pppdump $(OBJS)
clean:
rm -f pppdump $(OBJS) *~
install:
mkdir -p $(BINDIR) $(MANDIR)
- $(INSTALL) -s -c pppdump $(BINDIR)
+ $(INSTALL) -c pppdump $(BINDIR)
$(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -83,6 +83,7 @@
COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
+LDFLAGS=$(LDOPTS)
ifdef CHAPMS
CFLAGS += -DCHAPMS=1
@@ -102,7 +103,7 @@
CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
TARGETS += srp-entry
-EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
MANPAGES += srp-entry.8
EXTRACLEAN += srp-entry.o
NEEDDES=y
@@ -208,13 +209,13 @@
install: pppd
mkdir -p $(BINDIR) $(MANDIR)
$(EXTRAINSTALL)
- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
chmod o-rx,u+s $(BINDIR)/pppd; fi
$(INSTALL) -c -m 444 pppd.8 $(MANDIR)
pppd: $(PPPDOBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
+ $(CC) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
srp-entry: srp-entry.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)

47
debian/patches/no_crypt_hack vendored Normal file
View File

@ -0,0 +1,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
@@ -1442,8 +1442,10 @@ check_passwd(unit, auser, userlen, apass
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
@@ -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
--- a/pppd/session.c
+++ b/pppd/session.c
@@ -351,8 +351,10 @@ session_start(flags, user, passwd, ttyNa
*/
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;
}

172
debian/patches/ppp-2.3.11-oedod.dif vendored Normal file
View File

@ -0,0 +1,172 @@
--- a/pppd/demand.c
+++ b/pppd/demand.c
@@ -36,6 +36,8 @@
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
+#include <unistd.h>
+#include <syslog.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -43,6 +45,8 @@
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#ifdef PPP_FILTER
#include <pcap-bpf.h>
#endif
@@ -221,6 +225,14 @@ loop_chars(p, n)
int c, rv;
rv = 0;
+
+/* check for synchronous connection... */
+
+ if ( (p[0] == 0xFF) && (p[1] == 0x03) ) {
+ rv = loop_frame(p,n);
+ return rv;
+ }
+
for (; n > 0; --n) {
c = *p++;
if (c == PPP_FLAG) {
@@ -299,17 +311,102 @@ loop_frame(frame, len)
* loopback, now that the real serial link is up.
*/
void
-demand_rexmit(proto)
+demand_rexmit(proto, newip)
int proto;
+ u_int32_t newip;
{
struct packet *pkt, *prev, *nextpkt;
+ unsigned short checksum;
+ unsigned short pkt_checksum = 0;
+ unsigned iphdr;
+ struct timeval tv;
+ char cv = 0;
+ char ipstr[16];
prev = NULL;
pkt = pend_q;
pend_q = NULL;
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */
for (; pkt != NULL; pkt = nextpkt) {
nextpkt = pkt->next;
if (PPP_PROTOCOL(pkt->data) == proto) {
+ if ( (proto == PPP_IP) && newip ) {
+ /* Get old checksum */
+
+ iphdr = (pkt->data[4] & 15) << 2;
+ checksum = *((unsigned short *) (pkt->data+14));
+ if (checksum == 0xFFFF) {
+ checksum = 0;
+ }
+
+
+ if (pkt->data[13] == 17) {
+ pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr));
+ if (pkt_checksum) {
+ cv = 1;
+ if (pkt_checksum == 0xFFFF) {
+ pkt_checksum = 0;
+ }
+ }
+ else {
+ cv = 0;
+ }
+ }
+
+ if (pkt->data[13] == 6) {
+ pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr));
+ cv = 1;
+ if (pkt_checksum == 0xFFFF) {
+ pkt_checksum = 0;
+ }
+ }
+
+ /* Delete old Source-IP-Address */
+ checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
+ checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
+
+ pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
+ pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
+
+ /* Change Source-IP-Address */
+ * ((u_int32_t *) (pkt->data + 16)) = newip;
+
+ /* Add new Source-IP-Address */
+ checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
+ checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
+
+ pkt_checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF;
+ pkt_checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF;
+
+ /* Write new checksum */
+ if (!checksum) {
+ checksum = 0xFFFF;
+ }
+ *((unsigned short *) (pkt->data+14)) = checksum;
+ if (pkt->data[13] == 6) {
+ *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum;
+ }
+ if (cv && (pkt->data[13] == 17) ) {
+ *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum;
+ }
+
+ /* Log Packet */
+ strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16))));
+ if (pkt->data[13] == 1) {
+ syslog(LOG_INFO,"Open ICMP %s -> %s\n",
+ ipstr,
+ inet_ntoa(*( (struct in_addr *) (pkt->data+20))));
+ } else {
+ syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n",
+ pkt->data[13] == 6 ? "TCP" : "UDP",
+ ipstr,
+ ntohs(*( (short *) (pkt->data+iphdr+4))),
+ inet_ntoa(*( (struct in_addr *) (pkt->data+20))),
+ ntohs(*( (short *) (pkt->data+iphdr+6))));
+ }
+ }
output(0, pkt->data, pkt->length);
free(pkt);
} else {
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -1875,7 +1875,7 @@ ipcp_up(f)
proxy_arp_set[f->unit] = 1;
}
- demand_rexmit(PPP_IP);
+ demand_rexmit(PPP_IP,go->ouraddr);
sifnpmode(f->unit, PPP_IP, NPMODE_PASS);
} else {
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
@@ -1232,7 +1232,7 @@ ipv6cp_up(f)
}
}
- demand_rexmit(PPP_IPV6);
+ demand_rexmit(PPP_IPV6,0);
sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS);
} else {
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -564,7 +564,7 @@ void demand_conf __P((void)); /* config
void demand_block __P((void)); /* set all NPs to queue up packets */
void demand_unblock __P((void)); /* set all NPs to pass packets */
void demand_discard __P((void)); /* set all NPs to discard packets */
-void demand_rexmit __P((int)); /* retransmit saved frames for an NP */
+void demand_rexmit __P((int, u_int32_t)); /* retransmit saved frames for an NP*/
int loop_chars __P((unsigned char *, int)); /* process chars from loopback */
int loop_frame __P((unsigned char *, int)); /* should we bring link up? */

35
debian/patches/ppp-2.4.2-stripMSdomain vendored Normal file
View File

@ -0,0 +1,35 @@
diff -ruN ppp.orig/pppd/chap-new.c ppp/pppd/chap-new.c
--- ppp.orig/pppd/chap-new.c 2003-11-27 23:25:17.000000000 +0100
+++ ppp/pppd/chap-new.c 2003-12-02 12:26:21.000000000 +0100
@@ -57,6 +57,7 @@
int chap_timeout_time = 3;
int chap_max_transmits = 10;
int chap_rechallenge_time = 0;
+int chapms_strip_domain = 0;
/*
* Command-line options.
@@ -68,6 +69,8 @@
"Set max #xmits for challenge", OPT_PRIO },
{ "chap-interval", o_int, &chap_rechallenge_time,
"Set interval for rechallenge", OPT_PRIO },
+ { "chapms-strip-domain", o_bool, &chapms_strip_domain,
+ "Strip the domain prefix before the Username", 1 },
{ NULL }
};
@@ -338,6 +341,14 @@
/* Null terminate and clean remote name. */
slprintf(rname, sizeof(rname), "%.*v", len, name);
name = rname;
+
+ /* strip the MS domain name */
+ if (chapms_strip_domain && strrchr(rname, '\\')) {
+ char tmp[MAXNAMELEN+1];
+
+ strcpy(tmp, strrchr(rname, '\\') + 1);
+ strcpy(rname, tmp);
+ }
}
if (chap_verify_hook)

View File

@ -0,0 +1,31 @@
Description: fix a potential buffer overflow in clientid.c:rc_map2id()
This fixes the following compile-time warning when building with
-D_FORTIFY_SOURCE=2:
In file included from /usr/include/string.h:638:0,
from ./includes.h:26,
from clientid.c:12:
In function 'strncat',
inlined from 'rc_map2id' at clientid.c:113:9:
/usr/include/i386-linux-gnu/bits/string3.h:150:3: warning: call to
__builtin___strncat_chk might overflow destination buffer [enabled by default]
return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
^
Origin: vendor, https://build.opensuse.org/source/network/ppp/ppp-2.4.4-strncatfix.patch?rev=7a0fdeff0b29437dd7f4581c95c7255a
Forwarded: no
Reviewed-by: Chris Boot <bootc@debian.org>
Last-Update: 2014-01-12
--- ppp-2.4.4/pppd/plugins/radius/clientid.c.xx 2006-12-19 10:25:19.000000000 +0100
+++ ppp-2.4.4/pppd/plugins/radius/clientid.c 2006-12-19 10:25:45.000000000 +0100
@@ -110,7 +110,7 @@
if (*name != '/')
strcpy(ttyname, "/dev/");
- strncat(ttyname, name, sizeof(ttyname));
+ strncat(ttyname, name, sizeof(ttyname)-strlen(ttyname)-1);
for(p = map2id_list; p; p = p->next)
if (!strcmp(ttyname, p->name)) return p->id;

30
debian/patches/pppd-soname-hack.patch vendored Normal file
View File

@ -0,0 +1,30 @@
Description: Add a SONAME to the pppd binary
This hack inserts a SONAME into the pppd binary, which allows us to
run dpkg-gensymbols/dh_makeshlibs over the resulting binary. This is
useful so that we can use Debian's standard build infrastructure to
help track the ppp binary's ABI, which is used by plugins.
Author: Chris Boot <bootc@debian.org>
Forwarded: not-needed
Last-Update: 2015-12-05
--- ppp-2.4.7.orig/pppd/Makefile.linux
+++ ppp-2.4.7/pppd/Makefile.linux
@@ -206,6 +206,8 @@ endif
INSTALL= install
+VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' patchlevel.h)
+
all: $(TARGETS)
install: pppd
@@ -217,7 +219,8 @@ install: pppd
$(INSTALL) -c -m 444 pppd.8 $(MANDIR)
pppd: $(PPPDOBJS)
- $(CC) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
+ $(CC) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS) \
+ -Wl,-soname,pppd.so.$(VERSION)
srp-entry: srp-entry.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)

49
debian/patches/pppdump_use_zlib vendored Normal file
View File

@ -0,0 +1,49 @@
support building pppdump with the system zlib
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
@@ -2,18 +2,42 @@ DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
+DO_DEFLATE=y
+DO_BSD_COMPRESS=y
+HAVE_ZLIB=n
+
COPTS=-O2 -g
CFLAGS= $(COPTS) -I../include/net
LDFLAGS=$(LDOPTS)
-OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
+OBJS = pppdump.o
+LIBS =
+
+ifdef DO_DEFLATE
+CFLAGS += -DDO_DEFLATE=1
+OBJS += deflate.o
+ifdef HAVE_ZLIB
+LIBS += -lz
+else
+OBJS += zlib.o
+endif
+else
+CFLAGS += -DDO_DEFLATE=0
+endif
+
+ifdef DO_BSD_COMPRESS
+CFLAGS += -DDO_BSD_COMPRESS=1
+OBJS += bsd-comp.o
+else
+CFLAGS += -DDO_BSD_COMPRESS=0
+endif
INSTALL= install
all: pppdump
pppdump: $(OBJS)
- $(CC) $(LDFLAGS) -o pppdump $(OBJS)
+ $(CC) $(LDFLAGS) -o pppdump $(OBJS) $(LIBS)
clean:
rm -f pppdump $(OBJS) *~

78
debian/patches/pppoatm_cleanup vendored Normal file
View File

@ -0,0 +1,78 @@
cosmetic cleanup of the pppoatm plugin
Removed some debugging messages and generally cleaned up the source.
--- a/pppd/plugins/pppoatm/pppoatm.c
+++ b/pppd/plugins/pppoatm/pppoatm.c
@@ -70,18 +70,20 @@ static int setdevname_pppoatm(const char
{
struct sockaddr_atmpvc addr;
extern struct stat devstat;
+
if (device_got_set)
return 0;
- //info("PPPoATM setdevname_pppoatm: '%s'", cp);
+
memset(&addr, 0, sizeof addr);
if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr),
- T2A_PVC | T2A_NAME) < 0) {
- if(doit)
- info("atm does not recognize: %s", cp);
+ T2A_PVC | T2A_NAME | T2A_WILDCARD) < 0) {
+ if (doit)
+ info("cannot parse the ATM address: %s", cp);
return 0;
- }
- if (!doit) return 1;
- //if (!dev_set_ok()) return -1;
+ }
+ if (!doit)
+ return 1;
+
memcpy(&pvcaddr, &addr, sizeof pvcaddr);
strlcpy(devnam, cp, sizeof devnam);
devstat.st_mode = S_IFSOCK;
@@ -93,7 +95,6 @@ static int setdevname_pppoatm(const char
lcp_allowoptions[0].neg_asyncmap = 0;
lcp_wantoptions[0].neg_pcompression = 0;
}
- info("PPPoATM setdevname_pppoatm - SUCCESS:%s", cp);
device_got_set = 1;
return 1;
}
@@ -108,6 +109,7 @@ static void no_device_given_pppoatm(void
static void set_line_discipline_pppoatm(int fd)
{
struct atm_backend_ppp be;
+
be.backend_num = ATM_BACKEND_PPP;
if (!llc_encaps)
be.encaps = PPPOATM_ENCAPS_VC;
@@ -115,6 +117,7 @@ static void set_line_discipline_pppoatm(
be.encaps = PPPOATM_ENCAPS_LLC;
else
be.encaps = PPPOATM_ENCAPS_AUTODETECT;
+
if (ioctl(fd, ATM_SETBACKEND, &be) < 0)
fatal("ioctl(ATM_SETBACKEND): %m");
}
@@ -174,7 +177,7 @@ static void disconnect_pppoatm(void)
void plugin_init(void)
{
-#if defined(__linux__)
+#ifdef linux
extern int new_style_driver; /* From sys-linux.c */
if (!ppp_available() && !new_style_driver)
fatal("Kernel doesn't support ppp_generic - "
@@ -182,9 +185,9 @@ void plugin_init(void)
#else
fatal("No PPPoATM support on this OS");
#endif
- info("PPPoATM plugin_init");
add_options(pppoa_options);
}
+
struct channel pppoa_channel = {
options: pppoa_options,
process_extra_options: NULL,

76
debian/patches/pppoatm_resolver_light vendored Normal file
View File

@ -0,0 +1,76 @@
disable unneeded code in the pppoatm plugin
This patch halves the size of the PPPoA plugin by disabling features
which are never used with normal DSL connections (i.e. parsing of QoS
configuration directives and DNS resolution of VP/VC addresses).
It is especially useful for install images and embedded systems.
A next step could be removing text2qos.c, text2atm.c, misc.c and ans.c
and encourage users interested in the complete features to link the
plugin with the real libatm. I really doubt anybody cares, anyway.
--- a/pppd/plugins/pppoatm/Makefile.linux
+++ b/pppd/plugins/pppoatm/Makefile.linux
@@ -25,9 +25,13 @@ ifdef HAVE_LIBATM
LIBS := -latm
else
CFLAGS += -I.
+PLUGIN_OBJS += text2atm.o
+ifdef USE_FULL_ATM_RESOLVER
+CFLAGS += -DUSE_FULL_ATM_RESOLVER
PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o
LIBS := -lresolv
endif
+endif
#*********
all: $(PLUGIN)
--- a/pppd/plugins/pppoatm/pppoatm.c
+++ b/pppd/plugins/pppoatm/pppoatm.c
@@ -142,8 +142,12 @@ static int connect_pppoatm(void)
qos.txtp.traffic_class = qos.rxtp.traffic_class = ATM_UBR;
/* TODO: support simplified QoS setting */
if (qosstr != NULL)
+#ifdef USE_FULL_ATM_RESOLVER
if (text2qos(qosstr, &qos, 0))
fatal("Can't parse QoS: \"%s\"");
+#else
+ fatal("qos support has not been compiled in");
+#endif
qos.txtp.max_sdu = lcp_allowoptions[0].mru + pppoatm_overhead();
qos.rxtp.max_sdu = lcp_wantoptions[0].mru + pppoatm_overhead();
qos.aal = ATM_AAL5;
--- a/pppd/plugins/pppoatm/text2atm.c
+++ b/pppd/plugins/pppoatm/text2atm.c
@@ -72,6 +72,7 @@ static int try_pvc(const char *text,stru
}
+#ifdef USE_FULL_ATM_RESOLVER
static int do_try_nsap(const char *text,struct sockaddr_atmsvc *addr,int flags)
{
const char *walk;
@@ -221,6 +222,7 @@ static int try_name(const char *text,str
(void) fclose(file);
return result;
}
+#endif
int text2atm(const char *text,struct sockaddr *addr,int length,int flags)
@@ -234,6 +236,7 @@ int text2atm(const char *text,struct soc
result = try_pvc(text,(struct sockaddr_atmpvc *) addr,flags);
if (result != TRY_OTHER) return result;
}
+#ifdef USE_FULL_ATM_RESOLVER
if ((flags & T2A_SVC) && length >= sizeof(struct sockaddr_atmsvc)) {
result = try_nsap(text,(struct sockaddr_atmsvc *) addr,flags);
if (result != TRY_OTHER) return result;
@@ -245,5 +248,6 @@ int text2atm(const char *text,struct soc
if (result == TRY_OTHER && !(flags & T2A_LOCAL))
result = ans_byname(text,(struct sockaddr_atmsvc *) addr,length,flags);
if (result != TRY_OTHER) return result;
+#endif
return -1;
}

12
debian/patches/pppoe_noads vendored Normal file
View File

@ -0,0 +1,12 @@
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
@@ -345,9 +345,6 @@ plugin_init(void)
}
add_options(Options);
-
- info("RP-PPPoE plugin version %s compiled against pppd %s",
- RP_VERSION, VERSION);
}
void pppoe_check_options(void)

View File

@ -0,0 +1,303 @@
From: Matteo Croce <matteo@openwrt.org>
Date: Sat, 21 Nov 2015 18:45:43 +0100
Subject: [PATCH] pppoe: custom host-uniq tag
Forwarded: https://github.com/paulusmack/ppp/pull/28
Reviewed-by: Chris Boot <bootc@debian.org>
Add pppoe 'host-uniq' option to set an arbitrary
host-uniq tag instead of the pppd pid.
Some ISPs use such tag to authenticate the CPE,
so it must be set to a proper value to connect.
Signed-off-by: Matteo Croce <matteo@openwrt.org>
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
---
pppd/plugins/rp-pppoe/common.c | 14 ++++-----
pppd/plugins/rp-pppoe/discovery.c | 51 +++++++++++++--------------------
pppd/plugins/rp-pppoe/plugin.c | 7 ++++-
pppd/plugins/rp-pppoe/pppoe-discovery.c | 38 +++++++++++++++---------
pppd/plugins/rp-pppoe/pppoe.h | 31 +++++++++++++++++++-
5 files changed, 86 insertions(+), 55 deletions(-)
diff --git a/pppd/plugins/rp-pppoe/common.c b/pppd/plugins/rp-pppoe/common.c
index 89c633c773f9..8f175ece345b 100644
--- a/pppd/plugins/rp-pppoe/common.c
+++ b/pppd/plugins/rp-pppoe/common.c
@@ -119,15 +119,11 @@ sendPADT(PPPoEConnection *conn, char const *msg)
conn->session = 0;
/* If we're using Host-Uniq, copy it over */
- if (conn->useHostUniq) {
- PPPoETag hostUniq;
- pid_t pid = getpid();
- hostUniq.type = htons(TAG_HOST_UNIQ);
- hostUniq.length = htons(sizeof(pid));
- memcpy(hostUniq.payload, &pid, sizeof(pid));
- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
- cursor += sizeof(pid) + TAG_HDR_SIZE;
- plen += sizeof(pid) + TAG_HDR_SIZE;
+ if (conn->hostUniq.length) {
+ int len = ntohs(conn->hostUniq.length);
+ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
+ cursor += len + TAG_HDR_SIZE;
+ plen += len + TAG_HDR_SIZE;
}
/* Copy error message */
diff --git a/pppd/plugins/rp-pppoe/discovery.c b/pppd/plugins/rp-pppoe/discovery.c
index 04877cb8295f..5db8d0defc37 100644
--- a/pppd/plugins/rp-pppoe/discovery.c
+++ b/pppd/plugins/rp-pppoe/discovery.c
@@ -80,13 +80,10 @@ static void
parseForHostUniq(UINT16_t type, UINT16_t len, unsigned char *data,
void *extra)
{
- int *val = (int *) extra;
- if (type == TAG_HOST_UNIQ && len == sizeof(pid_t)) {
- pid_t tmp;
- memcpy(&tmp, data, len);
- if (tmp == getpid()) {
- *val = 1;
- }
+ PPPoETag *tag = extra;
+
+ if (type == TAG_HOST_UNIQ && len == ntohs(tag->length)) {
+ tag->length = memcmp(data, tag->payload, len);
}
}
@@ -104,16 +101,16 @@ parseForHostUniq(UINT16_t type, UINT16_t len, unsigned char *data,
static int
packetIsForMe(PPPoEConnection *conn, PPPoEPacket *packet)
{
- int forMe = 0;
+ PPPoETag hostUniq = conn->hostUniq;
/* If packet is not directed to our MAC address, forget it */
if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0;
/* If we're not using the Host-Unique tag, then accept the packet */
- if (!conn->useHostUniq) return 1;
+ if (!conn->hostUniq.length) return 1;
- parsePacket(packet, parseForHostUniq, &forMe);
- return forMe;
+ parsePacket(packet, parseForHostUniq, &hostUniq);
+ return !hostUniq.length;
}
/**********************************************************************
@@ -301,16 +298,12 @@ sendPADI(PPPoEConnection *conn)
}
/* If we're using Host-Uniq, copy it over */
- if (conn->useHostUniq) {
- PPPoETag hostUniq;
- pid_t pid = getpid();
- hostUniq.type = htons(TAG_HOST_UNIQ);
- hostUniq.length = htons(sizeof(pid));
- memcpy(hostUniq.payload, &pid, sizeof(pid));
- CHECK_ROOM(cursor, packet.payload, sizeof(pid) + TAG_HDR_SIZE);
- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
- cursor += sizeof(pid) + TAG_HDR_SIZE;
- plen += sizeof(pid) + TAG_HDR_SIZE;
+ if (conn->hostUniq.length) {
+ int len = ntohs(conn->hostUniq.length);
+ CHECK_ROOM(cursor, packet.payload, len + TAG_HDR_SIZE);
+ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
+ cursor += len + TAG_HDR_SIZE;
+ plen += len + TAG_HDR_SIZE;
}
/* Add our maximum MTU/MRU */
@@ -478,16 +471,12 @@ sendPADR(PPPoEConnection *conn)
cursor += namelen + TAG_HDR_SIZE;
/* If we're using Host-Uniq, copy it over */
- if (conn->useHostUniq) {
- PPPoETag hostUniq;
- pid_t pid = getpid();
- hostUniq.type = htons(TAG_HOST_UNIQ);
- hostUniq.length = htons(sizeof(pid));
- memcpy(hostUniq.payload, &pid, sizeof(pid));
- CHECK_ROOM(cursor, packet.payload, sizeof(pid)+TAG_HDR_SIZE);
- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
- cursor += sizeof(pid) + TAG_HDR_SIZE;
- plen += sizeof(pid) + TAG_HDR_SIZE;
+ if (conn->hostUniq.length) {
+ int len = ntohs(conn->hostUniq.length);
+ CHECK_ROOM(cursor, packet.payload, len+TAG_HDR_SIZE);
+ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
+ cursor += len + TAG_HDR_SIZE;
+ plen += len + TAG_HDR_SIZE;
}
/* Add our maximum MTU/MRU */
diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
index c89be94250bc..eb395182f77c 100644
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
@@ -68,6 +68,7 @@ static char *existingSession = NULL;
static int printACNames = 0;
static char *pppoe_reqd_mac = NULL;
unsigned char pppoe_reqd_mac_addr[6];
+static char *host_uniq = NULL;
static int PPPoEDevnameHook(char *cmd, char **argv, int doit);
static option_t Options[] = {
@@ -85,6 +86,8 @@ static option_t Options[] = {
"Be verbose about discovered access concentrators"},
{ "pppoe-mac", o_string, &pppoe_reqd_mac,
"Only connect to specified MAC address" },
+ { "host-uniq", o_string, &host_uniq,
+ "Specify custom Host-Uniq" },
{ NULL }
};
int (*OldDevnameHook)(char *cmd, char **argv, int doit) = NULL;
@@ -110,7 +113,6 @@ PPPOEInitDevice(void)
conn->ifName = devnam;
conn->discoverySocket = -1;
conn->sessionSocket = -1;
- conn->useHostUniq = 1;
conn->printACNames = printACNames;
conn->discoveryTimeout = PADI_TIMEOUT;
return 1;
@@ -166,6 +168,9 @@ PPPOEConnectDevice(void)
if (lcp_wantoptions[0].mru > ifr.ifr_mtu - TOTAL_OVERHEAD)
lcp_wantoptions[0].mru = ifr.ifr_mtu - TOTAL_OVERHEAD;
+ if (host_uniq && !parseHostUniq(host_uniq, &conn->hostUniq))
+ fatal("Illegal value for host-uniq option");
+
conn->acName = acName;
conn->serviceName = pppd_pppoe_service;
strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
index 3d3bf4eecc81..f4f527128c2f 100644
--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
+++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
@@ -347,7 +347,7 @@ packetIsForMe(PPPoEConnection *conn, PPPoEPacket *packet)
if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0;
/* If we're not using the Host-Unique tag, then accept the packet */
- if (!conn->useHostUniq) return 1;
+ if (!conn->hostUniq.length) return 1;
parsePacket(packet, parseForHostUniq, &forMe);
return forMe;
@@ -473,16 +473,12 @@ sendPADI(PPPoEConnection *conn)
cursor += namelen + TAG_HDR_SIZE;
/* If we're using Host-Uniq, copy it over */
- if (conn->useHostUniq) {
- PPPoETag hostUniq;
- pid_t pid = getpid();
- hostUniq.type = htons(TAG_HOST_UNIQ);
- hostUniq.length = htons(sizeof(pid));
- memcpy(hostUniq.payload, &pid, sizeof(pid));
- CHECK_ROOM(cursor, packet.payload, sizeof(pid) + TAG_HDR_SIZE);
- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
- cursor += sizeof(pid) + TAG_HDR_SIZE;
- plen += sizeof(pid) + TAG_HDR_SIZE;
+ if (conn->hostUniq.length) {
+ int len = ntohs(conn->hostUniq.length);
+ CHECK_ROOM(cursor, packet.payload, len + TAG_HDR_SIZE);
+ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
+ cursor += len + TAG_HDR_SIZE;
+ plen += len + TAG_HDR_SIZE;
}
packet.length = htons(plen);
@@ -644,7 +640,7 @@ int main(int argc, char *argv[])
memset(conn, 0, sizeof(PPPoEConnection));
- while ((opt = getopt(argc, argv, "I:D:VUAS:C:h")) > 0) {
+ while ((opt = getopt(argc, argv, "I:D:VUW:AS:C:h")) > 0) {
switch(opt) {
case 'S':
conn->serviceName = xstrdup(optarg);
@@ -653,7 +649,23 @@ int main(int argc, char *argv[])
conn->acName = xstrdup(optarg);
break;
case 'U':
- conn->useHostUniq = 1;
+ if(conn->hostUniq.length) {
+ fprintf(stderr, "-U and -W are mutually exclusive\n");
+ exit(EXIT_FAILURE);
+ }
+ char pidbuf[5];
+ snprintf(pidbuf, sizeof(pidbuf), "%04x", getpid());
+ parseHostUniq(pidbuf, &conn->hostUniq);
+ break;
+ case 'W':
+ if(conn->hostUniq.length) {
+ fprintf(stderr, "-U and -W are mutually exclusive\n");
+ exit(EXIT_FAILURE);
+ }
+ if (!parseHostUniq(optarg, &conn->hostUniq)) {
+ fprintf(stderr, "Invalid host-uniq argument: %s\n", optarg);
+ exit(EXIT_FAILURE);
+ }
break;
case 'D':
conn->debugFile = fopen(optarg, "w");
diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
index 9ab2eee3914c..86d2b1e47a25 100644
--- a/pppd/plugins/rp-pppoe/pppoe.h
+++ b/pppd/plugins/rp-pppoe/pppoe.h
@@ -21,6 +21,8 @@
#include <stdio.h> /* For FILE */
#include <sys/types.h> /* For pid_t */
+#include <ctype.h>
+#include <string.h>
/* How do we access raw Ethernet devices? */
#undef USE_LINUX_PACKET
@@ -235,7 +237,7 @@ typedef struct PPPoEConnectionStruct {
char *serviceName; /* Desired service name, if any */
char *acName; /* Desired AC name, if any */
int synchronous; /* Use synchronous PPP */
- int useHostUniq; /* Use Host-Uniq tag */
+ PPPoETag hostUniq; /* Use Host-Uniq tag */
int printACNames; /* Just print AC names */
FILE *debugFile; /* Debug file for dumping packets */
int numPADOs; /* Number of PADO packets received */
@@ -291,6 +293,33 @@ void pppoe_printpkt(PPPoEPacket *packet,
void (*printer)(void *, char *, ...), void *arg);
void pppoe_log_packet(const char *prefix, PPPoEPacket *packet);
+static inline int parseHostUniq(const char *uniq, PPPoETag *tag)
+{
+ int i, len = strlen(uniq);
+
+#define hex(x) \
+ (((x) <= '9') ? ((x) - '0') : \
+ (((x) <= 'F') ? ((x) - 'A' + 10) : \
+ ((x) - 'a' + 10)))
+
+ if (len % 2)
+ return 0;
+
+ for (i = 0; i < len; i += 2)
+ {
+ if (!isxdigit(uniq[i]) || !isxdigit(uniq[i+1]))
+ return 0;
+
+ tag->payload[i / 2] = (char)(16 * hex(uniq[i]) + hex(uniq[i+1]));
+ }
+
+#undef hex
+
+ tag->type = htons(TAG_HOST_UNIQ);
+ tag->length = htons(len / 2);
+ return 1;
+}
+
#define SET_STRING(var, val) do { if (var) free(var); var = strDup(val); } while(0);
#define CHECK_ROOM(cursor, start, len) \
--
2.8.1

View File

@ -0,0 +1,33 @@
Description: Correct unkown => unknown typo
Author: Chris Boot <bootc@debian.org>
Last-Update: 2013-09-09
--- ppp-2.4.5+git20130610.orig/pppd/plugins/radius/config.c
+++ ppp-2.4.5+git20130610/pppd/plugins/radius/config.c
@@ -271,7 +271,7 @@ char *rc_conf_str(char *optname)
option = find_option(optname, OT_STR);
if (option == NULL)
- fatal("rc_conf_str: unkown config option requested: %s", optname);
+ fatal("rc_conf_str: unknown config option requested: %s", optname);
return (char *)option->val;
}
@@ -282,7 +282,7 @@ int rc_conf_int(char *optname)
option = find_option(optname, OT_INT|OT_AUO);
if (option == NULL)
- fatal("rc_conf_int: unkown config option requested: %s", optname);
+ fatal("rc_conf_int: unknown config option requested: %s", optname);
return *((int *)option->val);
}
@@ -293,7 +293,7 @@ SERVER *rc_conf_srv(char *optname)
option = find_option(optname, OT_SRV);
if (option == NULL)
- fatal("rc_conf_srv: unkown config option requested: %s", optname);
+ fatal("rc_conf_srv: unknown config option requested: %s", optname);
return (SERVER *)option->val;
}

30
debian/patches/radius_mtu vendored Normal file
View File

@ -0,0 +1,30 @@
add support for the Framed-MTU Radius attribute
http://ppp.samba.org/cgi-bin/ppp-bugs/incoming?id=1532
From: klepikov_a@up.ua
To: ppp-bugs@ppp.samba.org
Subject: Radius plugin does not set MTU on ppp interface
Date: Mon, 22 Jan 2007 12:36:59 +0000 (GMT)
Full_Name: Alexander Klepikov
Version: 2.4.3
OS: rhl 7.3 (2.4.20-28.7bigmem)
Submission from: (NULL) (213.130.21.73)
This patch allows radius plugin to deal with Framed-MTU Radius attribute and to
set MTU on interface.
--- a/pppd/plugins/radius/radius.c
+++ b/pppd/plugins/radius/radius.c
@@ -657,6 +657,9 @@ radius_setparams(VALUE_PAIR *vp, char *m
memcpy(rstate.class, vp->strvalue, rstate.class_len);
} /* else too big for our buffer - ignore it */
break;
+ case PW_FRAMED_MTU:
+ netif_set_mtu(rstate.client_port,MIN(netif_get_mtu(rstate.client_port),vp->lvalue));
+ break;
}

View File

@ -0,0 +1,23 @@
Description: Fix buffer overflow in rc_mksid()
rc_mksid converts the PID of pppd to hex to generate a pseudo-unique string.
.
If the process id is bigger than 65535 (FFFF), its hex representation will be
longer than 4 characters, resulting in a buffer overflow.
.
The bug can be exploited to cause a remote DoS.
.
Author: Emanuele Rocca <ema@debian.org>
Bug-Debian: https://bugs.debian.org/782450
Last-Update: <2015-04-14>
--- ppp-2.4.6.orig/pppd/plugins/radius/util.c
+++ ppp-2.4.6/pppd/plugins/radius/util.c
@@ -77,7 +77,7 @@ rc_mksid (void)
static unsigned short int cnt = 0;
sprintf (buf, "%08lX%04X%02hX",
(unsigned long int) time (NULL),
- (unsigned int) getpid (),
+ (unsigned int) getpid () % 65535,
cnt & 0xFF);
cnt++;
return buf;

15
debian/patches/readable_connerrs vendored Normal file
View File

@ -0,0 +1,15 @@
make _PATH_CONNERRS world readable
There is nothing security-sensitive there.
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -1637,7 +1637,7 @@ device_script(program, in, out, dont_wai
if (log_to_fd >= 0)
errfd = log_to_fd;
else
- errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0600);
+ errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0644);
++conn_running;
pid = safe_fork(in, out, errfd);

File diff suppressed because it is too large Load Diff

11
debian/patches/resolv.conf_no_log vendored Normal file
View File

@ -0,0 +1,11 @@
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -2063,7 +2063,7 @@ create_resolv(peerdns1, peerdns2)
f = fopen(_PATH_RESOLV, "w");
if (f == NULL) {
- error("Failed to create %s: %m", _PATH_RESOLV);
+ /* error("Failed to create %s: %m", _PATH_RESOLV); */
return;
}

View File

@ -0,0 +1,19 @@
Description: Change path to expect in secure-card example script
This fixes the lintian warning:
I: ppp: example-wrong-path-for-interpreter
usr/share/doc/ppp/examples/scripts/secure-card
(#!/usr/local/bin/expect != /usr/bin/expect)
Author: Chris Boot <bootc@debian.org>
Forwarded: not-needed
Last-Update: 2013-09-09
--- ppp-2.4.5+git20130610.orig/scripts/secure-card
+++ ppp-2.4.5+git20130610/scripts/secure-card
@@ -1,4 +1,4 @@
-#!/usr/local/bin/expect -f
+#!/usr/bin/expect -f
#
# This script was written by Jim Isaacson <jcisaac@crl.com>. It is
# designed to work as a script to use the SecureCARD(tm) device. This

65
debian/patches/series vendored Normal file
View File

@ -0,0 +1,65 @@
# merged in upstream Git, but not yet released
0001-abort-on-errors-in-subdir-builds.patch
#0002-pppd-add-support-for-defaultroute-metric-option.patch
0003-scripts-Avoid-killing-wrong-pppd.patch
0004-pppd-Fix-sign-extension-when-displaying-bytes-in-oct.patch
0005-Suppress-false-error-message-on-PPPoE-disconnect.patch
0006-Send-PADT-on-PPPoE-disconnect.patch
0007-pppd-ipxcp-Prevent-buffer-overrun-on-remote-router-n.patch
0008-pppd-Fix-ccp_options.mppe-type.patch
0009-pppd-Fix-ccp_cilen-calculated-size-if-both-deflate_c.patch
0010-Fix-a-typo-in-comment.-Diff-from-Yuuichi-Someya.patch
0011-plog-count-only-relevant-lines-from-syslog.patch
0012-Change-include-from-sys-errno.h-to-errno.h.patch
0013-pppd-allow-use-of-arbitrary-interface-names.patch
0014-pppd-Remove-unused-declaration-of-ttyname.patch
0015-pppd-Provide-error-implementation-in-pppoe-discovery.patch
0016-pppoe-include-netinet-in.h-before-linux-in.h.patch
# to be merged upstream
adaptive_echos
makefiles_cleanup
close_dev_ppp
chat_man
fix_linkpidfile
pppdump_use_zlib
pppoatm_resolver_light
pppoatm_cleanup
pppoe_noads
readable_connerrs
radius-config.c-unkown-typo
# github pull requests
pr-28-pppoe-custom-host-uniq-tag.patch
# not ready to be merged
011_scripts_redialer.diff
cifdefroute.dif
ppp-2.3.11-oedod.dif
radius_mtu
# rejected by the upstream maintainer
018_ip-up_option.diff
ppp-2.4.2-stripMSdomain
setenv_call_file
ipv6-accept-remote
ppp-2.4.4-strncatfix.patch
# debian-specific
010_scripts_README.diff
no_crypt_hack
resolv.conf_no_log
zzz_config
secure-card-interpreter-fix
rc_mksid-no-buffer-overflow
pppd-soname-hack.patch
eaptls-mppe.patch
replace-vendored-hash-functions.patch
# nmu
glibc-2.28.patch
# ubuntu
load_ppp_generic_if_needed
CVE-2020-8597.patch

24
debian/patches/setenv_call_file vendored Normal file
View File

@ -0,0 +1,24 @@
export $CALL_FILE to the link scripts
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -1472,6 +1472,7 @@ callfile(argv)
if ((fname = (char *) malloc(l)) == NULL)
novm("call file name");
slprintf(fname, l, "%s%s", _PATH_PEERFILES, arg);
+ script_setenv("CALL_FILE", arg, 0);
ok = options_from_file(fname, 1, 1, 1);
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -1656,6 +1656,9 @@ the connection.
.B LINKNAME
The logical name of the link, set with the \fIlinkname\fR option.
.TP
+.B CALL_FILE
+The value of the \fIcall\fR option.
+.TP
.B DNS1
If the peer supplies DNS server addresses, this variable is set to the
first DNS server address supplied (whether or not the usepeerdns

69
debian/patches/zzz_config vendored Normal file
View File

@ -0,0 +1,69 @@
Debian-specific changes.
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -61,14 +61,14 @@ HAVE_MULTILINK=y
USE_TDB=y
HAS_SHADOW=y
-#USE_PAM=y
+USE_PAM=y
HAVE_INET6=y
# Enable plugins
PLUGIN=y
# Enable Microsoft proprietary Callback Control Protocol
-#CBCP=y
+CBCP=y
# Enable EAP SRP-SHA1 authentication (requires libsrp)
#USE_SRP=y
@@ -182,11 +182,9 @@ LIBS += -ldl
endif
ifdef FILTER
-ifneq ($(wildcard /usr/include/pcap-bpf.h),)
LIBS += -lpcap
CFLAGS += -DPPP_FILTER
endif
-endif
ifdef HAVE_INET6
PPPDSRCS += ipv6cp.c eui64.c
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
@@ -2,9 +2,9 @@ DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
-DO_DEFLATE=y
+#DO_DEFLATE=y
DO_BSD_COMPRESS=y
-HAVE_ZLIB=n
+HAVE_ZLIB=y
COPTS=-O2 -g
CFLAGS= $(COPTS) -I../include/net
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
@@ -28,7 +28,7 @@
#define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up"
#define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down"
#define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options."
-#define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors"
+#define _PATH_CONNERRS _ROOT_PATH "/var/log/ppp-connect-errors"
#define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/"
#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -852,7 +852,7 @@ extern void (*snoop_send_hook) __P((unsi
|| defined(DEBUGCHAP) || defined(DEBUG) || defined(DEBUGIPV6CP)
#define LOG_PPP LOG_LOCAL2
#else
-#define LOG_PPP LOG_DAEMON
+#define LOG_PPP LOG_LOCAL2
#endif
#endif /* LOG_PPP */

1
debian/po/POTFILES.in vendored Normal file
View File

@ -0,0 +1 @@
[type: gettext/rfc822deb] ppp-udeb.templates

169
debian/po/be.po vendored Normal file
View File

@ -0,0 +1,169 @@
# translation of be.po_[k9cdzb].po to Belarusian (Official spelling)
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Pavel Piatruk <berserker@neolocation.com>, 2007.
# Pavel Piatruk <piatruk.p@gmail.com>, 2008.
msgid ""
msgstr ""
"Project-Id-Version: be.po_[k9cdzb]\n"
"Report-Msgid-Bugs-To: ppp@packages.debian.org\n"
"POT-Creation-Date: 2012-09-02 11:02-0400\n"
"PO-Revision-Date: 2008-11-20 23:20+0200\n"
"Last-Translator: Pavel Piatruk <piatruk.p@gmail.com>\n"
"Language-Team: Belarusian (Official spelling) <i18n@mova.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
#. Type: text
#. Description
#. Main menu item
#: ../ppp-udeb.templates:2001
msgid "Configure and start a PPPoE connection"
msgstr "Наладзіць і запусціць злучэнне PPPoE"
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001
msgid "No PPPoE concentrator"
msgstr "Без канцэтратара PPPoE"
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001
msgid ""
"All network interfaces have been probed, but a PPPoE concentrator was not "
"detected."
msgstr ""
"Усе сеткавыя інтэрфейсы былі апрабаваныя, але не вызначана PPPoE "
"канцэнтратара."
#. Type: error
#. Description
#. Type: error
#. Description
#. Type: error
#. Description
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001 ../ppp-udeb.templates:7001
#: ../ppp-udeb.templates:9001 ../ppp-udeb.templates:10001
msgid ""
"The configuration of PPPoE has been aborted. It can be attempted again by "
"selecting the relevant menu entry."
msgstr ""
"Наладжванне PPPoE перарвана. Спроба можа быць здзейснена зноў выбарам "
"адпаведнага пункта меню."
#. Type: string
#. Description
#: ../ppp-udeb.templates:4001
msgid "Interface name:"
msgstr ""
#. Type: string
#. Description
#: ../ppp-udeb.templates:4001
#, fuzzy
#| msgid "Please enter the username for the PPP connection."
msgid ""
"Please enter the name of the network interface connected to the PPPoE modem."
msgstr "Калі ласка, увядзіце імя карыстальніка для злучэння PPP."
#. Type: string
#. Description
#: ../ppp-udeb.templates:5001
msgid "ISP account username:"
msgstr "Логін інтэрнэт-рахунка:"
#. Type: string
#. Description
#: ../ppp-udeb.templates:5001
msgid "Please enter the username for the PPP connection."
msgstr "Калі ласка, увядзіце імя карыстальніка для злучэння PPP."
#. Type: string
#. Description
#. Type: password
#. Description
#: ../ppp-udeb.templates:5001 ../ppp-udeb.templates:6001
msgid ""
"This information should have been provided by your Internet Service Provider."
msgstr ""
"Гэтая інфармацыя павінна быць прадастаўлена вам вашым Інтэрнэт-правайдэрам."
#. Type: password
#. Description
#: ../ppp-udeb.templates:6001
msgid "ISP account password:"
msgstr "Пароль інтэрнэт-рахунка:"
#. Type: password
#. Description
#: ../ppp-udeb.templates:6001
msgid "Please enter the password for the PPP connection."
msgstr "Калі ласка, увядзіце пароль для злучэння PPP."
#. Type: error
#. Description
#: ../ppp-udeb.templates:7001
msgid "No Ethernet interface"
msgstr "Няма інтэрфейса Ethernet"
#. Type: error
#. Description
#: ../ppp-udeb.templates:7001
msgid ""
"PPPoE networking cannot be configured because no Ethernet interface was "
"detected."
msgstr ""
"Сеціва PPPoE не можа быць наладжана, бо не вызначана інтэрфейсаў Ethernet."
#. Type: text
#. Description
#: ../ppp-udeb.templates:8001
msgid "Searching for concentrators on ${IFACE}..."
msgstr "Пошук канцэнтратараў на ${IFACE}..."
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid "Failed authentication"
msgstr "Спраўджванне не атрымалася"
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid ""
"A PPPoE connection was attempted, but the provided login information was "
"probably incorrect."
msgstr ""
"Спроба злучэння PPPoE была здзейснена, але прадастаўленыя звесткі ўвахода "
"некарэктныя."
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid "Please check the username and password you provided."
msgstr "Калі ласка, праверце ўведзеныя логін ды пароль."
#. Type: error
#. Description
#: ../ppp-udeb.templates:10001
msgid "Unhandled error"
msgstr "Неапрацавальная памылка"
#. Type: error
#. Description
#: ../ppp-udeb.templates:10001
msgid "An unidentified error happened while attempting to create a connection."
msgstr "Невызначаная памылка адбылася падчас спробы злучэння."
#. Type: text
#. Description
#: ../ppp-udeb.templates:11001
msgid "Please wait..."
msgstr "Калі ласка, чакайце..."

184
debian/po/ca.po vendored Normal file
View File

@ -0,0 +1,184 @@
#
# Catalan translation for ppp package.
# Copyright (C) 2008 Marco d'Itri.
# This file is distributed under the same license as the ppp package.
#
# Jordà Polo <jorda@ettin.org>, 2007, 2008.
#
msgid ""
msgstr ""
"Project-Id-Version: 2.4.4rel-10\n"
"Report-Msgid-Bugs-To: ppp@packages.debian.org\n"
"POT-Creation-Date: 2012-09-02 11:02-0400\n"
"PO-Revision-Date: 2008-11-20 19:04+0100\n"
"Last-Translator: Jordà Polo <jorda@ettin.org>\n"
"Language-Team: Catalan <debian-l10n-catalan@lists.debian.org>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: text
#. Description
#. Main menu item
#: ../ppp-udeb.templates:2001
msgid "Configure and start a PPPoE connection"
msgstr "Configura i inicia una connexió PPPoE"
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001
msgid "No PPPoE concentrator"
msgstr "No s'ha trobat el concentrador PPPoE"
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001
msgid ""
"All network interfaces have been probed, but a PPPoE concentrator was not "
"detected."
msgstr ""
"S'han provat totes les interfícies de xarxa, però no s'ha detectat cap "
"concentrador PPPoE."
#. Type: error
#. Description
#. Type: error
#. Description
#. Type: error
#. Description
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001 ../ppp-udeb.templates:7001
#: ../ppp-udeb.templates:9001 ../ppp-udeb.templates:10001
msgid ""
"The configuration of PPPoE has been aborted. It can be attempted again by "
"selecting the relevant menu entry."
msgstr ""
"S'ha avortat la configuració del PPPoE. Podeu tornar-ho a intentar "
"seleccionant l'entrada del menú corresponent."
#. Type: string
#. Description
#: ../ppp-udeb.templates:4001
msgid "Interface name:"
msgstr ""
#. Type: string
#. Description
#: ../ppp-udeb.templates:4001
#, fuzzy
#| msgid "Please enter the username for the PPP connection."
msgid ""
"Please enter the name of the network interface connected to the PPPoE modem."
msgstr "Si us plau, introduïu el nom d'usuari de la connexió PPP."
#. Type: string
#. Description
#: ../ppp-udeb.templates:5001
msgid "ISP account username:"
msgstr "Nom d'usuari del compte de l'ISP:"
#. Type: string
#. Description
#: ../ppp-udeb.templates:5001
msgid "Please enter the username for the PPP connection."
msgstr "Si us plau, introduïu el nom d'usuari de la connexió PPP."
#. Type: string
#. Description
#. Type: password
#. Description
#: ../ppp-udeb.templates:5001 ../ppp-udeb.templates:6001
msgid ""
"This information should have been provided by your Internet Service Provider."
msgstr ""
"Aquesta informació us l'hauria de proporcionar el vostre proveïdor de "
"serveis d'Internet."
#. Type: password
#. Description
#: ../ppp-udeb.templates:6001
msgid "ISP account password:"
msgstr "Contrasenya del compte de l'ISP:"
#. Type: password
#. Description
#: ../ppp-udeb.templates:6001
msgid "Please enter the password for the PPP connection."
msgstr "Si us plau, introduïu la contrasenya de la connexió PPP."
#. Type: error
#. Description
#: ../ppp-udeb.templates:7001
msgid "No Ethernet interface"
msgstr "No s'ha trobat la interfície Ethernet"
#. Type: error
#. Description
#: ../ppp-udeb.templates:7001
msgid ""
"PPPoE networking cannot be configured because no Ethernet interface was "
"detected."
msgstr ""
"No s'ha pogut configurar la xarxa PPPoE ja que no ha estat possible detectar "
"cap interfície Ethernet."
#. Type: text
#. Description
#: ../ppp-udeb.templates:8001
msgid "Searching for concentrators on ${IFACE}..."
msgstr "S'està cercant un concentrador a ${IFACE}..."
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid "Failed authentication"
msgstr "L'autenticació ha fallat"
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid ""
"A PPPoE connection was attempted, but the provided login information was "
"probably incorrect."
msgstr ""
"S'ha intentat establir una connexió PPPoE, però el nom d'usuari indicat "
"segurament és incorrecte."
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid "Please check the username and password you provided."
msgstr "Comproveu el nom d'usuari i la contrasenya que heu introduït."
#. Type: error
#. Description
#: ../ppp-udeb.templates:10001
msgid "Unhandled error"
msgstr "Error inesperat"
#. Type: error
#. Description
#: ../ppp-udeb.templates:10001
msgid "An unidentified error happened while attempting to create a connection."
msgstr ""
"S'ha trobat un error no identificat mentre s'intentava establir la connexió."
#. Type: text
#. Description
#: ../ppp-udeb.templates:11001
msgid "Please wait..."
msgstr "Si us plau, espereu..."
#~ msgid "PPP login:"
#~ msgstr "Nom d'usuari PPP:"
#~ msgid ""
#~ "It seems that the attempt to create a connection resulted in an unhandled "
#~ "error. Probably there is some exceptional situation which prevents "
#~ "establishing the connection."
#~ msgstr ""
#~ "Sembla que l'intent d'establir la connexió ha provocat un error "
#~ "inesperat. És probable que alguna situació excepcional impedeixi "
#~ "l'establiment de la connexió."

167
debian/po/cs.po vendored Normal file
View File

@ -0,0 +1,167 @@
# Czech PO debconf template translation of ppp.
# Copyright (C) 2007 Miroslav Kure <kurem@debian.cz>>
# This file is distributed under the same license as the ppp package.
# Miroslav Kure <kurem@debian.cz>, 2007 - 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: ppp 2.4.5-5.1\n"
"Report-Msgid-Bugs-To: ppp@packages.debian.org\n"
"POT-Creation-Date: 2012-08-30 14:53-0400\n"
"PO-Revision-Date: 2012-09-09 13:02+0100\n"
"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: text
#. Description
#. Main menu item
#: ../ppp-udeb.templates:2001
msgid "Configure and start a PPPoE connection"
msgstr "Nastavit a spustit PPPoE spojení"
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001
msgid "No PPPoE concentrator"
msgstr "Žádný PPPoE koncentrátor"
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001
msgid ""
"All network interfaces have been probed, but a PPPoE concentrator was not "
"detected."
msgstr ""
"Byla prověřena všechna síťová rozhraní, ale nebyl rozpoznán žádný PPPoE "
"koncentrátor."
#. Type: error
#. Description
#. Type: error
#. Description
#. Type: error
#. Description
#. Type: error
#. Description
#: ../ppp-udeb.templates:3001 ../ppp-udeb.templates:7001
#: ../ppp-udeb.templates:9001 ../ppp-udeb.templates:10001
msgid ""
"The configuration of PPPoE has been aborted. It can be attempted again by "
"selecting the relevant menu entry."
msgstr ""
"Nastavení PPPoE bylo přerušeno. Můžete se pokusit o nové nastavení výběrem "
"příslušné položky v menu."
#. Type: string
#. Description
#: ../ppp-udeb.templates:4001
msgid "Interface name:"
msgstr "Název rozhraní:"
#. Type: string
#. Description
#: ../ppp-udeb.templates:4001
msgid ""
"Please enter the name of the network interface connected to the PPPoE modem."
msgstr "Zadejte prosím název síťového rozhraní připojeného k PPPoE modemu."
#. Type: string
#. Description
#: ../ppp-udeb.templates:5001
msgid "ISP account username:"
msgstr "Uživatelské jméno u poskytovatele připojení:"
#. Type: string
#. Description
#: ../ppp-udeb.templates:5001
msgid "Please enter the username for the PPP connection."
msgstr "Zadejte prosím uživatelské jméno pro toto PPP spojení."
#. Type: string
#. Description
#. Type: password
#. Description
#: ../ppp-udeb.templates:5001 ../ppp-udeb.templates:6001
msgid ""
"This information should have been provided by your Internet Service Provider."
msgstr ""
"Tuto informaci by vám měl sdělit váš poskytovatel připojení k Internetu."
#. Type: password
#. Description
#: ../ppp-udeb.templates:6001
msgid "ISP account password:"
msgstr "Heslo u poskytovatele připojení:"
#. Type: password
#. Description
#: ../ppp-udeb.templates:6001
msgid "Please enter the password for the PPP connection."
msgstr "Zadejte prosím heslo pro toto PPP připojení."
#. Type: error
#. Description
#: ../ppp-udeb.templates:7001
msgid "No Ethernet interface"
msgstr "Žádné ethernetové rozhraní"
#. Type: error
#. Description
#: ../ppp-udeb.templates:7001
msgid ""
"PPPoE networking cannot be configured because no Ethernet interface was "
"detected."
msgstr ""
"Síťování pomocí PPPoE nemůže být nastaveno, protože nebylo rozpoznáno žádné "
"ethernetové rozhraní."
#. Type: text
#. Description
#: ../ppp-udeb.templates:8001
msgid "Searching for concentrators on ${IFACE}..."
msgstr "Hledám koncentrátory na ${IFACE}..."
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid "Failed authentication"
msgstr "Autentizace se nezdařila"
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid ""
"A PPPoE connection was attempted, but the provided login information was "
"probably incorrect."
msgstr ""
"Pokus o PPPoE spojení selhal, nejspíše kvůli chybným přihlašovacím údajům."
#. Type: error
#. Description
#: ../ppp-udeb.templates:9001
msgid "Please check the username and password you provided."
msgstr ""
"Zkontrolujte prosím, zda jste zadali správné uživatelské jméno a heslo."
#. Type: error
#. Description
#: ../ppp-udeb.templates:10001
msgid "Unhandled error"
msgstr "Neošetřená chyba"
#. Type: error
#. Description
#: ../ppp-udeb.templates:10001
msgid "An unidentified error happened while attempting to create a connection."
msgstr "Při pokusu o navázání spojení se vyskytla neznámá chyba."
#. Type: text
#. Description
#: ../ppp-udeb.templates:11001
msgid "Please wait..."
msgstr "Čekejte prosím..."

Some files were not shown because too many files have changed in this diff Show More