From 3146172cc72490952a1a04aea4a62a20950c5910 Mon Sep 17 00:00:00 2001 From: Tom Carroll <34632752+tomc797@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:33:51 -0700 Subject: [PATCH] fixup! Add support for Linux capabilities (7). --- programs/ziti-edge-tunnel/netif_driver/linux/capability.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/programs/ziti-edge-tunnel/netif_driver/linux/capability.c b/programs/ziti-edge-tunnel/netif_driver/linux/capability.c index 50777d3c..c733de1e 100644 --- a/programs/ziti-edge-tunnel/netif_driver/linux/capability.c +++ b/programs/ziti-edge-tunnel/netif_driver/linux/capability.c @@ -77,6 +77,9 @@ ziti__cap_assert(unsigned long linux_cap_mask, unsigned long flags) (void) flags; sys_rc = capget(&cap.header, cap.data); + /** + * Fallback to _LINUX_CAPABILITY_VERSION_1 when signalled + */ if (sys_rc && errno == EINVAL && cap.header.version < thread_state.saved_cap.header.version) { cap.header.version = _LINUX_CAPABILITY_VERSION_1; sys_rc = capget(&cap.header, cap.data); @@ -96,7 +99,7 @@ ziti__cap_assert(unsigned long linux_cap_mask, unsigned long flags) cap.data[0].permitted |= linux_cap_mask; /** - * If not changes to the capabilities, don't call capset + * Don't calling capset() if no new capabilities are needed. */ if ((cap.data[0].effective ^ saved_cap.data[0].effective) == 0 && (cap.data[0].permitted ^ saved_cap.data[0].permitted) == 0)