cap_get_file | Début | Suivant | Sommaire | Préc.page.lue | Accueil |
NAME | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Note: support for file capabilities is anticipated in Linux 2.6.23+
SYNOPSIS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
#include <sys/capability.h>
cap_t cap_get_file(const char *path_p);
int cap_set_file(const char *path_p, cap_t cap_p);
cap_t cap_get_fd(int fd);
USAGE | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
DESCRIPTION | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
cap_set_file and cap_set_fd set the values for all capability flags for all capabilities for the pathname pointed to by path_p or the file open on descriptor fd, with the capability state identified by cap_p. The new capability state of the file shall be completely determined by the contents of cap_p. A NULL value for cap_p is used to indicate that capabilities for the file should be deleted. For these functions to succeed, the calling process must have the CAP_SETFCAP capability enabled and either the effective user ID of the process must match the file owner or the calling process must have the effective flag of the CAP_FOWNER capability set. The effects of writing the capability state to any file type other than a regular file are undefined.
RETURN VALUE | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
cap_set_file and cap_set_fd return zero on success, and -1 on failure.
On failure, errno(3) is set to EACCES, EBADFD, ENAMETOOLONG, ENOENT, ENOMEM, ENOTDIR, EPERM, or EROFS.
CONFORMING TO | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
SEE ALSO | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Sommaire | Début | Suivant | Sommaire | Préc.page.lue | Accueil |