summaryrefslogtreecommitdiff
path: root/src/setfilecon.c
blob: 81322f89b6e40f659a248293ef3d73bd65826eda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/xattr.h>
#include "selinux_internal.h"
#include "policy.h"

int setfilecon(const char *path, const char *context)
{
	return setxattr(path, XATTR_NAME_SELINUX, context, strlen(context) + 1,
			0);
}