Beispiel #1
0
int apply_cipso_file(int fd)
{
	struct smack_cipso *cipso = NULL;
	int ret;

	cipso = smack_cipso_new(fd);
	if (cipso == NULL)
		return -1;

	ret = smack_cipso_apply(cipso);
	smack_cipso_free(cipso);
	if (ret)
		return -1;

	return 0;
}
Beispiel #2
0
int apply_cipso_file(int fd)
{
	struct smack_cipso *cipso = NULL;
	int ret;

	ret = smack_cipso_new(&cipso);
	if (ret)
		return -1;

	ret = smack_cipso_add_from_file(cipso, fd);
	if (ret) {
		smack_cipso_free(cipso);
		return -1;
	}

	ret = smack_cipso_apply(cipso);
	smack_cipso_free(cipso);
	if (ret)
		return -1;

	return 0;
}