static void
partition_cred_copy_label(struct label *src, struct label *dest)
{

	if (src != NULL && dest != NULL)
		SLOT_SET(dest, SLOT(src));
	else if (dest != NULL)
		SLOT_SET(dest, 0);
}
static void
partition_cred_relabel(struct ucred *cred, struct label *newlabel)
{

	if (newlabel != NULL && SLOT(newlabel) != 0)
		SLOT_SET(cred->cr_label, SLOT(newlabel));
}
static int
partition_cred_internalize_label(struct label *label, char *element_name,
    char *element_data, int *claimed)
{

	if (strcmp(MAC_PARTITION_LABEL_NAME, element_name) != 0)
		return (0);

	(*claimed)++;
	SLOT_SET(label, strtol(element_data, NULL, 10));
	return (0);
}
示例#4
0
object_t
set_local(context_t context, int uplevel, int offset, object_t value)
{
	object_t cur = context->env;
	if (cur == NULL) return NULL;
	while (uplevel > 0)
	{
		if (cur->environment.parent == OBJECT_NULL) return NULL;
		else cur = cur->environment.parent;
		-- uplevel;
	}

	if (offset >= cur->environment.length) return NULL;
	object_t result = SLOT_GET(cur->environment.slot_entry[offset]);
	if (IS_OBJECT(result))
		context_attach(context, result);
	SLOT_SET(cur->environment.slot_entry[offset], value);
	return result;
}
static void
partition_cred_init_label(struct label *label)
{

	SLOT_SET(label, 0);
}
static void
partition_cred_create_swapper(struct ucred *cred)
{

	SLOT_SET(cred->cr_label, 0);
}