ppp
ppp copied to clipboard
Bashism within redialer
redialer has /bin/sh
set as its interpreter, but uses bash function style and should probably changed like this:
diff -Ndur ppp-2.4.7/scripts/redialer ppp-2.4.7-fix-bashisms/scripts/redialer
--- ppp-2.4.7/scripts/redialer 2014-08-09 15:31:39.000000000 +0300
+++ ppp-2.4.7-fix-bashisms/scripts/redialer 2014-11-19 05:09:46.168864978 +0200
@@ -31,7 +31,7 @@
# 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
+initialize()
{
chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK'
return
@@ -41,7 +41,7 @@
#
# Script to dial a telephone
#
-function callnumber
+callnumber()
{
chat -v \
ABORT '\nBUSY\r' \
@@ -66,7 +66,7 @@
#
# Script to dial any telephone number
#
-function callall
+callall()
{
# echo "dialing attempt number: $1" >/dev/console
callnumber $PHONE1
@thesamesam You able to validate and craft a patch for this?
Actually I'm tempted to just delete the whole scripts directory. I'd be very surprised if any of it is still useful these days.
@paulusmack some scripts are used more frequently than others. Ubuntu still packages and supports the pon/poff style of invocations of pppd. I've been using it frequently to test pppd outside of network-manager and with setting up sstp-client.
Do debian & ubuntu package the scripts from here, or do they have their own versions?
The poff script in particular seems to be making policy decisions about how to identify and manage multiple pppd instances which don't seem to me to be within the scope of this project.
@paulusmack you are correct in that debian at least provides their own copy of these scripts with changes. Now, I don't know what other distributions do with the scripts directory, but at least for Debian:
See:
https://salsa.debian.org/moschlar/ppp/-/tree/master/debian/extra
We could probably keep the scripts directory under source control, but remove it from the distribution, i.e. make dist-gzip would roll a tar-ball that does not include these files. That would be to remove the scripts directory from ppp/Makefile.am's SUBDIRS variable and then remove scripts/Makefile.am.
@bootc: What do you think?
This would be a trivial thing to do on our end. Let's see what @bootc thinks
Also, @yarda does the script directories get used under RedHat? @thesamesam what about Gentoo?
We currently install scripts/{pon,poff,plog,chatchat} into PATH in /usr/sbin and install the rest in /usr/share/doc as documentation (so users have to actively seek them out, although we mention them in a post-install message).
We also roll our own net-dialup/ppp-scripts package which has additional scripts of our own, which we could possibly fold ^ into if you stop including them in the ppp distribution.
We install all scripts as doc/examples. Unfortunately, I don't know whether anybody is actively using them.