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