]>
Commit | Line | Data |
---|---|---|
8552b176 AK |
1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
2 | ||
3 | #pragma once | |
4 | ||
5 | /*** | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2013 Intel Corporation | |
9 | ||
10 | Author: Auke Kok <auke-jan.h.kok@intel.com> | |
11 | ||
12 | systemd is free software; you can redistribute it and/or modify it | |
13 | under the terms of the GNU Lesser General Public License as published by | |
14 | the Free Software Foundation; either version 2.1 of the License, or | |
15 | (at your option) any later version. | |
16 | ||
17 | systemd is distributed in the hope that it will be useful, but | |
18 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 | Lesser General Public License for more details. | |
21 | ||
22 | You should have received a copy of the GNU Lesser General Public License | |
23 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
24 | ***/ | |
25 | ||
26 | #include <stdbool.h> | |
27 | ||
5ab58c20 WC |
28 | #include "macro.h" |
29 | ||
30 | typedef enum SmackAttr { | |
31 | SMACK_ATTR_ACCESS = 0, | |
32 | SMACK_ATTR_EXEC = 1, | |
33 | SMACK_ATTR_MMAP = 2, | |
34 | SMACK_ATTR_TRANSMUTE = 3, | |
35 | SMACK_ATTR_IPIN = 4, | |
36 | SMACK_ATTR_IPOUT = 5, | |
37 | _SMACK_ATTR_MAX, | |
38 | _SMACK_ATTR_INVALID = -1, | |
39 | } SmackAttr; | |
40 | ||
6baa7db0 | 41 | bool mac_smack_use(void); |
b9c1bc28 | 42 | |
5dfc5461 | 43 | int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs); |
c80d766c | 44 | |
5ab58c20 WC |
45 | const char* smack_attr_to_string(SmackAttr i) _const_; |
46 | SmackAttr smack_attr_from_string(const char *s) _pure_; | |
47 | int mac_smack_read(const char *path, SmackAttr attr, char **label); | |
48 | int mac_smack_read_fd(int fd, SmackAttr attr, char **label); | |
49 | int mac_smack_apply(const char *path, SmackAttr attr, const char *label); | |
50 | int mac_smack_apply_fd(int fd, SmackAttr attr, const char *label); | |
51 | ||
2ca620c4 | 52 | int mac_smack_apply_pid(pid_t pid, const char *label); |