chiark / gitweb /
Prep v236 : Add missing SPDX-License-Identifier (2/9) src/basic
[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   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU Lesser General Public License as published by
13   the Free Software Foundation; either version 2.1 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   Lesser General Public License for more details.
20
21   You should have received a copy of the GNU Lesser General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <stdbool.h>
26 #include <sys/types.h>
27
28 #include "macro.h"
29
30 #define SMACK_FLOOR_LABEL "_"
31 #define SMACK_STAR_LABEL  "*"
32
33 #if 0 /// UNNEEDED by elogind
34 typedef enum SmackAttr {
35         SMACK_ATTR_ACCESS = 0,
36         SMACK_ATTR_EXEC = 1,
37         SMACK_ATTR_MMAP = 2,
38         SMACK_ATTR_TRANSMUTE = 3,
39         SMACK_ATTR_IPIN = 4,
40         SMACK_ATTR_IPOUT = 5,
41         _SMACK_ATTR_MAX,
42         _SMACK_ATTR_INVALID = -1,
43 } SmackAttr;
44 #endif // 0
45
46 bool mac_smack_use(void);
47
48 int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
49
50 #if 0 /// UNNEEDED by elogind
51 const char* smack_attr_to_string(SmackAttr i) _const_;
52 SmackAttr smack_attr_from_string(const char *s) _pure_;
53 int mac_smack_read(const char *path, SmackAttr attr, char **label);
54 int mac_smack_read_fd(int fd, SmackAttr attr, char **label);
55 int mac_smack_apply(const char *path, SmackAttr attr, const char *label);
56 int mac_smack_apply_fd(int fd, SmackAttr attr, const char *label);
57 int mac_smack_apply_pid(pid_t pid, const char *label);
58 int mac_smack_copy(const char *dest, const char *src);
59 #endif // 0