]> git.ipfire.org Git - thirdparty/openvpn.git/commit
dns: support running up/down command with privsep
authorHeiko Hund <heiko@ist.eigentlich.net>
Sat, 17 May 2025 08:38:27 +0000 (10:38 +0200)
committerGert Doering <gert@greenie.muc.de>
Sat, 17 May 2025 09:09:51 +0000 (11:09 +0200)
commit1dfe8729f6c65812bb2ee8a511c968d48d531840
tree4e51afa66bfeb0b117e26141aabfc04e168e527c
parent6c33e3761ecb476d047bc14e7948ffddba800915
dns: support running up/down command with privsep

With --user privileges are dropped after init. Unfortunately this
affects --dns-updown when undoing previous modifications.

To keep the privileges for just that, the concept of a dns updown runner
in introduced. It's basically a fork of openvpn at the time the
modifications to DNS are made. Its only capability is running the
--dns-updown command when asked to. The parent openvpn process signals
this by writing to a pipe the runner is waiting on.

Commands need to be ready to receive variables from a file instead of the
process environment. A shameless and effective workaround to keep the
protocol between the two processes simple.

Change-Id: I6b67e3a00dd84bf348b6af28115ee11138c3a111
Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20250517083833.28728-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31668.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
distro/dns-scripts/haikuos_file-dns-updown.sh
distro/dns-scripts/openresolv-dns-updown.sh
distro/dns-scripts/resolvconf_file-dns-updown.sh
distro/dns-scripts/systemd-dns-updown.sh
src/openvpn/dns.c
src/openvpn/dns.h
src/openvpn/env_set.c
src/openvpn/env_set.h
src/openvpn/init.c
src/openvpn/openvpn.h