avc_compute_create

NAME

avc_compute_create - obtain SELinux label for new object.

SYNOPSIS

#include <selinux/selinux.h>
#include <selinux/avc.h> I int avc_compute_create(security_id_t ssid , security_id_t tsid , I security_class_t tclass , security_id_t * newsid );

DESCRIPTION

avc_compute_create is used to compute a SID to use for labeling a new object in a particular class based on a SID pair. This call is identical to R security_compute_create , but does not require converting from userspace SID's to contexts and back again. avc_compute_create returns a SID for the computed context in the memory referenced by R sid , incrementing its reference count by 1.

RETURN VALUE

On success, zero is returned. On error, -1 is returned and errno is set appropriately.

ERRORS

EINVAL
The tclass and/or the security contexts referenced by ssid and tsid are not recognized by the currently loaded policy, or tsid or ssid has a zero reference count and is invalid.
ENOMEM
An attempt to allocate memory failed.

AUTHOR

Eamon Walsh <ewalsh@tycho.nsa.gov>

SEE ALSO