nm-l2tp / NetworkManager-l2tp

L2TP and L2TP/IPsec support for NetworkManager
GNU General Public License v2.0
486 stars 83 forks source link

utils.c: Some fixes #159

Closed rizalmart closed 3 years ago

rizalmart commented 3 years ago
rizalmart commented 3 years ago

Which Linux distro are you using?

It must be overriding SBINDIR env variable and setting it to a non-sbin dir when the xl2tpd package is built. e.g. here is where it checks at build time if SBINDIR is set in the xl2tpd Makefile :

https://github.com/xelerance/xl2tpd/blob/master/Makefile#L113

extract:

SBINDIR?=$(DESTDIR)${PREFIX}/sbin

Similarly with libreswan which uses a sbin dir : https://github.com/libreswan/libreswan/blob/main/mk/config.mk#L145

extract :

# SBINDIR is where the user interface command goes.
FINALSBINDIR ?= $(PREFIX)/sbin
SBINDIR ?= $(DESTDIR)$(FINALSBINDIR)

Im using Debian-built Puppy Linux. It means I used pre-compiled package. I noticed that IPSEC button was always disabled. Upon checking the this plugin looks for /sbin/ipsec. But the strongswan ipsec reside in /usr/bin/

dkosovic commented 3 years ago

DPupStretch (i386) seems to be based on Debian Stretch.

Debian Stretch uses /usr/sbin/ipsec as can be confirmed by the list of files in the strongswan-starter package :

So I'm not sure how or why Puppy Linux is using /usr/bin/ipsec instead of /usr/sbin/ipsec. I might try installing it myself in a VM.

I'm happy to add /usr/bin/ipsec and /usr/bin/xl2tpd to the binary paths to search, but removing or replacing /usr/sbin/ is going to break all the major Linux distros.

dkosovic commented 3 years ago

I tried BusterPup 8.0 CE which is based on Debian 10 and then installed strongswan and xl2tpd. It seems to be using /usr/sbin/ipsec and /usr/sbin/xl2tpd :

# uname -a
Linux puppypc5786 4.19.56-buster #1 SMP Sun Jun 30 16:57:41 EDT 2019 i686 GNU/Linux

# type ipsec
ipsec is /usr/sbin/ipsec

# type xl2tpd
xl2tpd is /usr/sbin/xl2tpd
dkosovic commented 3 years ago

Although I wasn't able to reproduce the issue with either Dpup Stretch 7.5 CE or BusterPup 8.0 CE, I have done commit# https://github.com/nm-l2tp/NetworkManager-l2tp/commit/75484bdffacbf017750862f527ec5735ab0d3278 which should fix your issue.

Some linux distros have unified /bin, /sbin and /usr/sbin into /usr/bin like Arch linux :