From b3bec79d36e453241eec927f10918733b7717204 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Wed, 23 Oct 2019 03:23:14 +0000 Subject: [PATCH] cap_sysctl: correct typo from r347534-ish operation & ~limit where limit is a bool is clearly not what was intended, given the line prior. Correct it to use the calculated mask for validation. The cap_sysctl tests should now be functional again. --- lib/libcasper/services/cap_sysctl/cap_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libcasper/services/cap_sysctl/cap_sysctl.c b/lib/libcasper/services/cap_sysctl/cap_sysctl.c index 40c4d033849d..a0ca0f6f8855 100644 --- a/lib/libcasper/services/cap_sysctl/cap_sysctl.c +++ b/lib/libcasper/services/cap_sysctl/cap_sysctl.c @@ -316,7 +316,7 @@ sysctl_valid(const nvlist_t *nvl, bool limit) */ mask = limit ? (CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE) : CAP_SYSCTL_RDWR; - if ((operation & ~limit) != 0 || + if ((operation & ~mask) != 0 || (operation & CAP_SYSCTL_RDWR) == 0) return (EINVAL); /* Only one 'operation' can be present. */