blob: 47022df9d974d56887f360db303e0900a6a12d2f [file] [log] [blame]
Stephen Smalleyf0740362012-01-04 12:30:47 -05001#include <unistd.h>
2#include <fcntl.h>
3#include <string.h>
4#include <stdlib.h>
5#include <errno.h>
6#include <sys/xattr.h>
7#include "selinux_internal.h"
8#include "policy.h"
9
10int setfilecon(const char *path, const security_context_t context)
11{
12 return setxattr(path, XATTR_NAME_SELINUX, context, strlen(context) + 1,
13 0);
14}
15