mirror of
https://github.com/openwrt/openwrt.git
synced 2026-12-05 08:46:08 +04:00
ppp: hand the pptp socket directory to the jailed pppd
The pptp plugin starts a call manager that binds its control socket in
/var/run/pptp/ and creates the directory first if it is missing. Since
pppd runs in ujail as user ppp, the call manager runs as that user too
and cannot create the directory in the root-owned /var/run. It exits
with "Could not make path to /var/run/pptp/...: Permission denied",
pppd ends with CONNECT_FAILED and netifd starts it again, in a loop.
Prepare /var/run/pptp the same way the jail setup prepares
/var/run/pppd: create it and chown it to ppp. The chown runs at every
setup, so a directory left by a pppd that ran as root is handed over
too.
Fixes: b855f33ea9 ("ppp: run pppd in ujail as an unprivileged user")
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26319
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
1 parent
3b7e7c00e2
commit
bd4d64e08b
2 files changed
+3
-3
No files matched your search
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ppp
|
||||
PKG_VERSION:=2.5.4
|
||||
PKG_RELEASE:=5
|
||||
PKG_RELEASE:=6
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://download.samba.org/pub/ppp
|
||||
|
||||
@@ -167,8 +167,8 @@ ppp_generic_setup() {
|
||||
[ -x /sbin/ujail ] && [ -f "$caps" ] && id -u ppp >/dev/null 2>&1 && {
|
||||
jail="/sbin/ujail -t 5 -n pppd -U ppp -G ppp -C $caps -c --"
|
||||
chown ppp /dev/ppp
|
||||
mkdir -p /var/run/pppd
|
||||
chown ppp /var/run/pppd
|
||||
mkdir -p /var/run/pppd /var/run/pptp
|
||||
chown ppp /var/run/pppd /var/run/pptp
|
||||
# pppd rewrites the peer DNS file behind /etc/ppp/resolv.conf at
|
||||
# every connect; one left by a root-run instance refuses uid 454
|
||||
rm -f /tmp/resolv.conf.ppp
|
||||
|
||||
Reference in new issue
Block a user