iofunc_ability_check()
Verify that the client has a given resource manager ability
Synopsis:
#include <sys/iofunc.h>
int iofunc_ability_check(
const resmgr_context_t * const ctp,
const iofunc_ability_e iofuncability );
Arguments:
- ctp
- A pointer to a resmgr_context_t structure that the resource-manager library uses to pass context information between functions.
- iofuncability
- The ID of the resource manager ability that you want to check for; one of the following:
- IOFUNC_ABILITYID_CHOWN
- IOFUNC_ABILITYID_DUP
- IOFUNC_ABILITYID_EXEC
- IOFUNC_ABILITYID_READ
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The iofunc_ability_check() function verifies that the client has the given resource manager ability. The resource manager library creates the following IDs (shown with the ability name and the corresponding constant):
Ability ID | Ability name | Description |
---|---|---|
IOFUNC_ABILITYID_CHOWN | iofunc/chown (IOFUNC_ABILITY_CHOWN) | Allow the client to set the ownership of files, even if not root |
IOFUNC_ABILITYID_DUP | iofunc/dup (IOFUNC_ABILITY_DUP) | Allow the client to duplicate another process's handle |
IOFUNC_ABILITYID_EXEC | iofunc/exec (IOFUNC_ABILITY_EXEC) | Grant execute access to files and directories that the client wouldn't normally have access to |
IOFUNC_ABILITYID_READ | iofunc/read (IOFUNC_ABILITY_READ) | Allow the client to access files for reading, even if it doesn't have the required permissions |
You typically use this function to check for special abilities after a call to iofunc_check_access() indicates that the client doesn't have the appropriate permissions to do an operation. These abilities can reduce the number of process manager abilities (see procmgr_ability()) that a client needs to keep.
Returns:
true if the client has the given ability; false if it doesn't.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |