public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -v3 1/5] Capabilities: document the order of arguments to cap_issubset
@ 2008-11-07 15:13 Eric Paris
  2008-11-07 15:14 ` [PATCH -v3 2/5] CAPABILITIES: add cpu endian vfs caps structure Eric Paris
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Eric Paris @ 2008-11-07 15:13 UTC (permalink / raw)
  To: linux-kernel, linux-audit; +Cc: sgrubb, morgan, serue, viro

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: Eric Paris <eparis@redhat.com>
---

 include/linux/capability.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/capability.h b/include/linux/capability.h
index 9d1fe30..9f44150 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -454,6 +454,13 @@ static inline int cap_isclear(const kernel_cap_t a)
 	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)
 {
 	kernel_cap_t dest;


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-11-10 14:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 15:13 [PATCH -v3 1/5] Capabilities: document the order of arguments to cap_issubset Eric Paris
2008-11-07 15:14 ` [PATCH -v3 2/5] CAPABILITIES: add cpu endian vfs caps structure Eric Paris
2008-11-07 15:14 ` [PATCH -v3 3/5] AUDIT: output permitted and inheritable fcaps in PATH records Eric Paris
2008-11-10 14:46   ` Serge E. Hallyn
2008-11-07 15:14 ` [PATCH -v3 4/5] AUDIT: collect info when execve results in caps in pE Eric Paris
2008-11-10 14:53   ` Serge E. Hallyn
2008-11-07 15:14 ` [PATCH -v3 5/5] AUDIT: emit new record type showing all capset information Eric Paris
2008-11-10 14:55   ` Serge E. Hallyn
2008-11-10 14:28 ` [PATCH -v3 1/5] Capabilities: document the order of arguments to cap_issubset Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox