blob: 17f8875902b1c7389a12bfa606dc00739734a97e [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
Stephen Smalleyab40ea92014-02-19 09:16:17 -050010int fsetfilecon(int fd, const char *context)
Stephen Smalleyf0740362012-01-04 12:30:47 -050011{
12 return fsetxattr(fd, XATTR_NAME_SELINUX, context, strlen(context) + 1,
13 0);
14}
15