#define MAC_PERM_CONTENTS 0b000001 #define MAC_PERM_READ 0b000010 #define MAC_PERM_WRITE 0b000100 #define MAC_PERM_EXEC 0b001000 #define MAC_PERM_APPEND 0b010000 #define MAC_PERM_FLOCK 0b100000 int add_mac_permissions(const char *path, int flags);
This syscall adds permissions to access an inode or device as described in Mandatory access control (MAC).
The syscall returns 0
on success or -1
on failure, with the
following errno:
EPERM
: MAC did not allow this.
EFAULT
: The passed pointer does not point to valid memory.
EAGAIN
: The system has reached a limit on registered rules.
EINVAL
: The passed rule is already covered or conflicts with an existent
one.