Bug 17209 - /sbin/pptp-command is broken due to ifconfig
Summary: /sbin/pptp-command is broken due to ifconfig
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal major
Target Milestone: ---
Assignee: Olav Vitters
QA Contact:
URL:
Whiteboard: MGA6TOO
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2015-11-23 18:58 CET by Nicolas Pomarède
Modified: 2020-09-14 13:36 CEST (History)
3 users (show)

See Also:
Source RPM: pptp-linux-1.7.2-9.mga5.src.rpm
CVE:
Status comment:


Attachments

Description Nicolas Pomarède 2015-11-23 18:58:07 CET
After migrating from mga4 to mga5, I noticed my VPN setups using pptp were not working anymore.

Basically, the route that can be added as a comment in the file /etc/ppp/peers/myvpn (where 'myvpn' is the name of one of my vpn) were not taken into account.
Looking at syslog, I see some errors :

systemd[1]: pptp.service: control process exited, code=exited status=143
systemd[1]: Failed to start LSB: This startup script launches pptp-command..
systemd[1]: Unit pptp.service entered failed state.
systemd[1]: pptp.service failed.

In that case, pptp is half started : the tunnel is up, but the script pptp-command is in fact failing before reaching the end, not adding the routes.

After some more debug, the problem is that the tunnel interface name is seen as "ppp0:" instead of "ppp0". So, "route add -net xxxxx dev ppp0:" will fail.

Looking at the script, it doesn't match the output of "ifconfig" (from net-tools-2.0-0.20140707git.6.mga5, mga4 was net-tools-1.60-38.mga4)

ifconfig gives :

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 996
        inet 192.168.120.1  netmask 255.255.255.255  destination 192.168.255.254
        ppp  txqueuelen 3  (Protocole Point-à-Point)
        RX packets 6  bytes 96 (96.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 102 (102.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But /sbin/pptp-command :

 - doesn't expect a ":" at the end of the interface's name, so it's not removed
possible fix is to add "$if =~ s/://" after "$if=$1" (near line 777)

 - expects the ip address to be on the 1st line and separated with ":"
(grep {/inet/} `/sbin/ifconfig $if`)[0] =~ /:(\d+\.\d+\.\d+\.\d+)/;
This is not correct anymore, ip address is on the 2nd line and not separated by a ":"


By modifying the above lines, I was able to have my VPN and its routes as before under mga4.

Nicolas
David Walser 2015-11-24 15:41:39 CET

Source RPM: (none) => pptp-linux-1.7.2-9.mga5.src.rpm
Assignee: bugsquad => pkg-bugs

Comment 1 Nicolas Pomarède 2015-11-30 19:24:01 CET
For further reference, this is the result of /sbin/ifconfig under mageia 4 :

eth0      Link encap:Ethernet  HWaddr 00:15:F2:F0:A1:6D
          inet adr:192.168.0.10  Bcast:192.168.0.255  Masque:255.255.255.0
          adr inet6: fe80::215:f2ff:fef0:a16d/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9507 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10261 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          RX bytes:5726777 (5.4 MiB)  TX bytes:2255831 (2.1 MiB)

lo        Link encap:Boucle locale  
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0 
          RX bytes:500 (500.0 b)  TX bytes:500 (500.0 b)

As can be seen, it's slightly different from what we have under mga5 / cauldron :
 - line with flags / MTU was moved as 1st line
 - there was no ':' after the interface's name

pptp can't work with the new layout in mga5/cauldron

Nicolas
Comment 2 Olav Vitters 2015-12-10 22:01:50 CET
I submitted 1.8.0 in Cauldron. It's old (2013), so doubt it'll fix things. Fedora has some patches, but nothing relevant. Can you ping upstream?

CC: (none) => olav

Comment 3 Marja Van Waes 2018-04-18 11:44:06 CEST
Hi Nicolas,

Thank you for having taken the needed time to report this issue!

Did this bug get fixed? If so, please change its status to RESOLVED - FIXED

If it didn't, then we regret that we weren't able to fix it in Mageia 5. Mageia 5 has officially reached its End of Life on December 31st, 2017 https://blog.mageia.org/en/2017/11/07/mageia-5-eol-postponed/
It only continued to get important security updates since then, because we are waiting for a big Plasma5 update in Mageia 6, that'll fix many of the Mageia 5 => 6 upgrade issues.

If you haven't seen that this bug got fixed, then please check whether this bug still exists in Mageia 6. If it does, then please change the Version (near the top, at the left) to "6". If you know it exists in Cauldron, then change Version to Cauldron. If you see it in both Cauldron and Mageia 6, then please set Version to Cauldron and add MGA6TOO on the Whiteboard.

Thanks,
Marja

(Btw, there's a new version 1.10.0 https://sourceforge.net/projects/pptpclient/files/pptp/pptp-1.10.0/pptp-1.10.0.tar.gz/download .. we have 1.8.0 in Cauldron)

CC: (none) => marja11

Comment 4 Nicolas Pomarède 2018-04-25 23:53:50 CEST
Hi

I confirm the problem is still present under mageia cauldron (ie next mageia 7), as this is the same script pptp-command as in mageia 5 ; I think it's certainly the same under mageia 6 too.

For example, the following patch would fix pptp-command to work as explained above.

--- /usr/sbin/pptp-command      2018-02-19 09:27:18.000000000 +0100
+++ pptp-command.new    2017-11-16 17:57:28.467032620 +0100
@@ -774,6 +774,8 @@
        }
        die "something screwy in your interface names: $if\n" if $if !~ /^($safe_re)$/o;
        $if = $1;
+# patch NP
+$if=~s/://;
        (grep {/inet/} `/sbin/ifconfig $if`)[0] =~ /:(\d+\.\d+\.\d+\.\d+)/;
        $ip = $1;

Not sure pptp-1.10.0 as posted above would fix the problem, as this tar.gz doesn't provide pptp-command.

Changing the report as asked.

Nicolas

Whiteboard: (none) => MGA6TOO
Version: 5 => Cauldron

Comment 5 Aurelien Oudelet 2020-09-10 16:04:46 CEST
Ping this bug report.
This is against Mageia 6.
Still valid?

CC: (none) => ouaurelien
Keywords: (none) => NEEDINFO

Comment 6 Nicolas Pomarède 2020-09-10 16:09:18 CEST
Hi,
yes still valid ; at least under mageia 7 I had to apply the patch from comment #4 to make it work.

Didn't look at mageia 8, but as pptp-command didn't change between mageia 7 and 8, the same patch is certainly needed too.

(in the meantime, I don't use pptp anymore myself to connect to my vbn at word but strongswan instead)

Nicolas
Comment 7 Nicolas Pomarède 2020-09-10 16:10:17 CEST
typo in comment #6 : "to connect to my vpn at work"
Olav Vitters 2020-09-14 13:36:57 CEST

Assignee: pkg-bugs => olav


Note You need to log in before you can comment on or make changes to this bug.