table of contents
avc_has_perm(3) | SELinux API documentation | avc_has_perm(3) |
NAME¶
avc_has_perm, avc_has_perm_noaudit, avc_audit, avc_entry_ref_init - obtain and audit SELinux access decisions.SYNOPSIS¶
#include <selinux/selinux.h>security_class_t tclass, access_vector_t requested,
security_class_t tclass, access_vector_t requested,
security_class_t tclass, access_vector_t requested,
DESCRIPTION¶
avc_entry_ref_init initializes an avc_entry_ref structure; see ENTRY REFERENCES below. This function may be implemented as a macro.ENTRY REFERENCES¶
Entry references can be used to speed cache performance for repeated queries on the same subject and target. The userspace AVC will check the aeref argument, if supplied, before searching the cache on a permission query. After a query is performed, aeref will be updated to reference the cache entry for that query. A subsequent query on the same subject and target will then have the decision at hand without having to walk the cache.RETURN VALUE¶
If requested permissions are granted, zero is returned. If requested permissions are denied or an error occured, -1 is returned and errno is set appropriately.ERRORS¶
- EACCES
- A requested permission was denied.
- EINVAL
- The tclass and/or the security contexts referenced by ssid and tsid are not recognized by the currently loaded policy.
- ENOMEM
- An attempt to allocate memory failed.
NOTES¶
Internal errors encountered by the userspace AVC may cause certain values of errno to be returned unexpectedly. For example, netlink socket errors may produce EACCES or EINVAL. Make sure that userspace object managers are granted appropriate access to netlink by the policy.AUTHOR¶
Eamon Walsh <ewalsh@tycho.nsa.gov>SEE ALSO¶
avc_init(3), avc_context_to_sid(3), avc_cache_stats(3), avc_add_callback(3), security_compute_av(3) selinux(8)27 May 2004 |