mirror of
https://github.com/SELinuxProject/selinux
synced 2025-03-02 08:20:24 +00:00
selinux_set_mapping: Document it
This patch may not actually be useful since there's a man page.
This commit is contained in:
parent
08359131a2
commit
d24fb6834d
@ -357,6 +357,25 @@ struct security_class_mapping {
|
||||
const char *perms[sizeof(access_vector_t) * 8 + 1];
|
||||
};
|
||||
|
||||
/**
|
||||
* selinux_set_mapping - Enable dynamic mapping between integer offsets and security class names
|
||||
* @map: array of security_class_mapping structures
|
||||
*
|
||||
* The core avc_has_perm() API uses integers to represent security
|
||||
* classes; previous to the introduction of this function, it was
|
||||
* common for userspace object managers to be compiled using generated
|
||||
* offsets for a particular policy. However, that strongly ties the build of the userspace components to a particular policy.
|
||||
*
|
||||
* By using this function to map between integer offsets and security
|
||||
* class names, it's possible to replace a system policies that have
|
||||
* at least the same set of security class names as used by the
|
||||
* userspace object managers.
|
||||
*
|
||||
* To correctly use this function, you should override the generated
|
||||
* security class defines from the system policy in a local header,
|
||||
* starting at 1, and have one security_class_mapping structure entry
|
||||
* per define.
|
||||
*/
|
||||
extern int selinux_set_mapping(struct security_class_mapping *map);
|
||||
|
||||
/* Common helpers */
|
||||
|
Loading…
Reference in New Issue
Block a user