chiark / gitweb /
6821d42450839fbc9cdbc2f6b9369b37d3b73a13
[elogind.git] / src / basic / smack-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   This file is part of systemd.
6
7   Copyright 2013 Intel Corporation
8
9   Author: Auke Kok <auke-jan.h.kok@intel.com>
10 ***/
11
12 #include <stdbool.h>
13 #include <sys/types.h>
14
15 //#include "label.h"
16 #include "macro.h"
17
18 #define SMACK_FLOOR_LABEL "_"
19 #define SMACK_STAR_LABEL  "*"
20
21 #if 0 /// UNNEEDED by elogind
22 typedef enum SmackAttr {
23         SMACK_ATTR_ACCESS,
24         SMACK_ATTR_EXEC,
25         SMACK_ATTR_MMAP,
26         SMACK_ATTR_TRANSMUTE,
27         SMACK_ATTR_IPIN,
28         SMACK_ATTR_IPOUT,
29         _SMACK_ATTR_MAX,
30         _SMACK_ATTR_INVALID = -1,
31 } SmackAttr;
32 #endif // 0
33
34 bool mac_smack_use(void);
35
36 int mac_smack_fix(const char *path, LabelFixFlags flags);
37
38 #if 0 /// UNNEEDED by elogind
39 const char* smack_attr_to_string(SmackAttr i) _const_;
40 SmackAttr smack_attr_from_string(const char *s) _pure_;
41 int mac_smack_read(const char *path, SmackAttr attr, char **label);
42 int mac_smack_read_fd(int fd, SmackAttr attr, char **label);
43 int mac_smack_apply(const char *path, SmackAttr attr, const char *label);
44 int mac_smack_apply_fd(int fd, SmackAttr attr, const char *label);
45 int mac_smack_apply_pid(pid_t pid, const char *label);
46 int mac_smack_copy(const char *dest, const char *src);
47 #endif // 0