Skip to content

Commit

Permalink
fixup! Add support for Linux capabilities (7).
Browse files Browse the repository at this point in the history
  • Loading branch information
tomc797 committed Oct 24, 2024
1 parent c110f8d commit 3146172
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion programs/ziti-edge-tunnel/netif_driver/linux/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit 3146172

Please sign in to comment.