Commit a4eecbae authored by Mateusz Guzik's avatar Mateusz Guzik Committed by Linus Torvalds

capability: add cap_isidentical

Signed-off-by: default avatarMateusz Guzik <mjguzik@gmail.com>
Reviewed-by: default avatarSerge Hallyn <serge@hallyn.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 10383068
......@@ -157,6 +157,16 @@ static inline bool cap_isclear(const kernel_cap_t a)
return true;
}
static inline bool cap_isidentical(const kernel_cap_t a, const kernel_cap_t b)
{
unsigned __capi;
CAP_FOR_EACH_U32(__capi) {
if (a.cap[__capi] != b.cap[__capi])
return false;
}
return true;
}
/*
* Check if "a" is a subset of "set".
* return true if ALL of the capabilities in "a" are also in "set"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment