summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch')
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch
new file mode 100644
index 000000000000..8ef99a4b7aa9
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch
@@ -0,0 +1,58 @@
+diff -Nru rp-pppoe-3.10.orig/scripts/pppoe-setup.in rp-pppoe-3.10/scripts/pppoe-setup.in
+--- rp-pppoe-3.10.orig/scripts/pppoe-setup.in 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/scripts/pppoe-setup.in 2008-06-30 22:23:40.000000000 +0200
+@@ -86,11 +86,13 @@
+ $ECHO "USER NAME"
+ $ECHO ""
+ printf "%s" ">>> Enter your PPPoE user name (default $USER): "
+- read U
++ read Uu
+
+- if [ "$U" = "" ] ; then
+- U="$USER"
++ if [ "$Uu" = "" ] ; then
++ Uu="$USER"
+ fi
++
++ U=`echo $Uu | sed -e "s/&/\\\\\&/g"`
+
+ # Under Linux, "fix" the default interface if eth1 is not available
+ if test `uname -s` = "Linux" ; then
+@@ -221,7 +223,7 @@
+ $ECHO "** Summary of what you entered **"
+ $ECHO ""
+ $ECHO "Ethernet Interface: $E"
+- $ECHO "User name: $U"
++ $ECHO "User name: $Uu"
+ if [ "$D" = "no" ] ; then
+ $ECHO "Activate-on-demand: No"
+ else
+@@ -288,7 +290,12 @@
+ fi
+
+ # Some #$(*& ISP's use a slash in the user name...
+-sed -e "s&^USER=.*&USER='$U'&" \
++for SEP in ':' ';' '/' '!' '|' '_' '-' '@' ; do
++ if [ "$U" = `echo $U | sed "sI${SEP}II"` ]; then
++ break;
++ fi
++done
++sed -e "s${SEP}^USER=.*${SEP}USER='$U'${SEP}"\
+ -e "s&^ETH=.*&ETH='$E'&" \
+ -e "s&^PIDFILE=.*&PIDFILE=\"$VARRUN/\$CF_BASE-pppoe.pid\"&" \
+ -e "s/^FIREWALL=.*/FIREWALL=$FIREWALL/" \
+@@ -337,10 +344,10 @@
+ cp /dev/null /etc/ppp/chap-secrets-bak
+ fi
+
+-egrep -v "^$U|^\"$U\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
+-$ECHO "\"$U\" * \"$PWD1\"" >> /etc/ppp/pap-secrets
+-egrep -v "^$U|^\"$U\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
+-$ECHO "\"$U\" * \"$PWD1\"" >> /etc/ppp/chap-secrets
++egrep -v "^$Uu|^\"$Uu\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
++$ECHO "\"$Uu\" * \"$PWD1\"" >> /etc/ppp/pap-secrets
++egrep -v "^$Uu|^\"$Uu\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
++$ECHO "\"$Uu\" * \"$PWD1\"" >> /etc/ppp/chap-secrets
+
+ $ECHO ""
+ $ECHO ""