o cap_set_flag() was not correctly clearing capabilities when value
was CAP_CLEAR. Obtained from: TrustedBSD Project
This commit is contained in:
parent
081cb6b302
commit
9f3aa35641
@ -23,7 +23,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* TrustedBSD Project - support for POSIX.1e process capabilities
|
* TrustedBSD Project - support for POSIX.1e process capabilities
|
||||||
@ -55,7 +55,10 @@ cap_set_flag(cap_t cap_p, cap_flag_t flag, int ncap, cap_value_t caps[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < ncap; i++)
|
for (i = 0; i < ncap; i++)
|
||||||
SET_CAPABILITY(mask, caps[i]);
|
if (value == CAP_SET)
|
||||||
|
SET_CAPABILITY(mask, caps[i]);
|
||||||
|
else
|
||||||
|
UNSET_CAPABILITY(mask, caps[i]);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* TrustedBSD Project - support for POSIX.1e process capabilities
|
* TrustedBSD Project - support for POSIX.1e process capabilities
|
||||||
@ -55,7 +55,10 @@ cap_set_flag(cap_t cap_p, cap_flag_t flag, int ncap, cap_value_t caps[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < ncap; i++)
|
for (i = 0; i < ncap; i++)
|
||||||
SET_CAPABILITY(mask, caps[i]);
|
if (value == CAP_SET)
|
||||||
|
SET_CAPABILITY(mask, caps[i]);
|
||||||
|
else
|
||||||
|
UNSET_CAPABILITY(mask, caps[i]);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user