capabilities: Ensure required capabilities are actually held by the process/user

This commit is contained in:
Tobias Brunner
2013-06-25 17:16:32 +02:00
parent a650242643
commit 2e21bac19a
5 changed files with 77 additions and 10 deletions
+7 -2
View File
@@ -1,4 +1,6 @@
/*
* Copyright (C) 2013 Tobias Brunner
* Hochschule fuer Technik Rapperswil
* Copyright (C) 2012 Martin Willi
* Copyright (C) 2012 revosec AG
*
@@ -36,11 +38,14 @@ typedef struct capabilities_t capabilities_t;
struct capabilities_t {
/**
* Register a capability to keep while calling drop().
* Register a capability to keep while calling drop(). Verifies that the
* capability is currently held.
*
* @param cap capability to keep
* @return FALSE if the capability is currently not held
*/
void (*keep)(capabilities_t *this, u_int cap);
bool (*keep)(capabilities_t *this,
u_int cap) __attribute__((warn_unused_result));
/**
* Get the user ID set through set_uid/resolve_uid.