提交 9d36be76 编写于 作者: E Eric Paris 提交者: James Morris

Document the order of arguments for cap_issubset. It's not instantly clear

which order the argument should be in.  So give an example.
Signed-off-by: NEric Paris <eparis@redhat.com>
Acked-by: NSerge Hallyn <serue@us.ibm.com>
Signed-off-by: NJames Morris <jmorris@namei.org>
上级 39c9aede
...@@ -457,6 +457,13 @@ static inline int cap_isclear(const kernel_cap_t a) ...@@ -457,6 +457,13 @@ static inline int cap_isclear(const kernel_cap_t a)
return 1; return 1;
} }
/*
* Check if "a" is a subset of "set".
* return 1 if ALL of the capabilities in "a" are also in "set"
* cap_issubset(0101, 1111) will return 1
* return 0 if ANY of the capabilities in "a" are not in "set"
* cap_issubset(1111, 0101) will return 0
*/
static inline int cap_issubset(const kernel_cap_t a, const kernel_cap_t set) static inline int cap_issubset(const kernel_cap_t a, const kernel_cap_t set)
{ {
kernel_cap_t dest; kernel_cap_t dest;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册