]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/selinux-util.h
Revert "selinux: split up mac_selinux_have() from mac_selinux_use()"
[thirdparty/systemd.git] / src / basic / selinux-util.h
CommitLineData
cad45ba1
LP
1#pragma once
2
3/***
4 This file is part of systemd.
5
6 Copyright 2010 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
22#include <stdbool.h>
71d35b6b 23#include <sys/socket.h>
11c3a366 24#include <sys/types.h>
cad45ba1 25
710a6b50
LP
26#include "macro.h"
27
6baa7db0
LP
28bool mac_selinux_use(void);
29void mac_selinux_retest(void);
66b6d9d5 30
c3dacc8b 31int mac_selinux_init(void);
cc56fafe 32void mac_selinux_finish(void);
66b6d9d5 33
6baa7db0 34int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
ecabcf8b 35int mac_selinux_apply(const char *path, const char *label);
66b6d9d5 36
cc56fafe
WC
37int mac_selinux_get_create_label_from_exe(const char *exe, char **label);
38int mac_selinux_get_our_label(char **label);
9008e1ac 39int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **label);
710a6b50 40char* mac_selinux_free(char *label);
66b6d9d5 41
ecabcf8b
LP
42int mac_selinux_create_file_prepare(const char *path, mode_t mode);
43void mac_selinux_create_file_clear(void);
66b6d9d5 44
ecabcf8b
LP
45int mac_selinux_create_socket_prepare(const char *label);
46void mac_selinux_create_socket_clear(void);
47
ecabcf8b 48int mac_selinux_bind(int fd, const struct sockaddr *addr, socklen_t addrlen);
710a6b50
LP
49
50DEFINE_TRIVIAL_CLEANUP_FUNC(char*, mac_selinux_free);