[Openvpn-devel] [PATCH] Retain CAP_NET_ADMIN when dropping privileges

2022-03-29 Thread Timo Rothenpieler
--- This patch sits on top of the current dco branch, and will not apply to latest master. It solves the issue of dropping root privileges breaking dco and sitnl due to missing NET_ADMIN capabilities. configure.ac | 3 ++ src/openvpn/init.c | 22 +- src/openvpn/platfo

[Openvpn-devel] [PATCH] Retain CAP_NET_ADMIN when dropping privileges

2022-03-30 Thread Timo Rothenpieler
--- configure.ac | 18 ++ distro/systemd/openvpn-cli...@.service.in | 2 +- distro/systemd/openvpn-ser...@.service.in | 2 +- src/openvpn/init.c| 25 ++- src/openvpn/platform.c| 79 +++ src/openv

Re: [Openvpn-devel] [PATCH] Retain CAP_NET_ADMIN when dropping privileges

2022-03-29 Thread Timo Rothenpieler
On 29.03.2022 21:29, Timo Rothenpieler wrote: +static bool +do_keep_caps(bool prepare) +{ +struct __user_cap_header_struct cap_hdr = { _LINUX_CAPABILITY_VERSION_3 }; +struct __user_cap_data_struct cap_data[_LINUX_CAPABILITY_U32S_3] = {}; + +if (syscall(SYS_capget, &cap_hdr, cap_data)

Re: [Openvpn-devel] [PATCH] Retain CAP_NET_ADMIN when dropping privileges

2022-03-30 Thread David Sommerseth
On 29/03/2022 21:29, Timo Rothenpieler wrote: --- This patch sits on top of the current dco branch, and will not apply to latest master. It solves the issue of dropping root privileges breaking dco and sitnl due to missing NET_ADMIN capabilities. configure.ac | 3 ++ src/openvpn/

Re: [Openvpn-devel] [PATCH] Retain CAP_NET_ADMIN when dropping privileges

2022-03-30 Thread David Sommerseth
On 30/03/2022 10:51, David Sommerseth wrote: On 29/03/2022 21:29, Timo Rothenpieler wrote: --- This patch sits on top of the current dco branch, and will not apply to latest master. It solves the issue of dropping root privileges breaking dco and sitnl due to missing NET_ADMIN capabilities.  

Re: [Openvpn-devel] [PATCH] Retain CAP_NET_ADMIN when dropping privileges

2022-03-30 Thread Timo Rothenpieler
On 30.03.2022 11:11, David Sommerseth wrote: On 30/03/2022 10:51, David Sommerseth wrote: On 29/03/2022 21:29, Timo Rothenpieler wrote: --- This patch sits on top of the current dco branch, and will not apply to latest master. It solves the issue of dropping root privileges breaking dco and si

Re: [Openvpn-devel] [PATCH] Retain CAP_NET_ADMIN when dropping privileges

2022-03-30 Thread Gert Doering
Hi, On Wed, Mar 30, 2022 at 01:31:24PM +0200, Timo Rothenpieler wrote: > > It is possible to argue that sitnl does low-level calls to the kernel as > > well.  But potential libraries had an API which was making everything > > far more complex on the OpenVPN side.  For libcap-ng at least, that is

Re: [Openvpn-devel] [PATCH] Retain CAP_NET_ADMIN when dropping privileges

2022-03-30 Thread Antonio Quartulli
Hi, On 30/03/2022 13:57, Gert Doering wrote: Hi, On Wed, Mar 30, 2022 at 01:31:24PM +0200, Timo Rothenpieler wrote: It is possible to argue that sitnl does low-level calls to the kernel as well.  But potential libraries had an API which was making everything far more complex on the OpenVPN sid