chiark / gitweb /
1509b1cc3d1ae0f0240fd897222c9834f3c45840
[elogind.git] / src / basic / selinux-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   This file is part of systemd.
6
7   Copyright 2010 Lennart Poettering
8 ***/
9
10 #include <stdbool.h>
11 #include <sys/socket.h>
12 #include <sys/types.h>
13
14 #include "macro.h"
15 //#include "label.h"
16
17 bool mac_selinux_use(void);
18 void mac_selinux_retest(void);
19
20 int mac_selinux_init(void);
21 void mac_selinux_finish(void);
22
23 int mac_selinux_fix(const char *path, LabelFixFlags flags);
24 #if 0 /// UNNEEDED by elogind
25 int mac_selinux_apply(const char *path, const char *label);
26
27 int mac_selinux_get_create_label_from_exe(const char *exe, char **label);
28 int mac_selinux_get_our_label(char **label);
29 int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **label);
30 #endif // 0
31 char* mac_selinux_free(char *label);
32
33 int mac_selinux_create_file_prepare(const char *path, mode_t mode);
34 void mac_selinux_create_file_clear(void);
35 #if 0 /// UNNEEDED by elogind
36
37 int mac_selinux_create_socket_prepare(const char *label);
38 void mac_selinux_create_socket_clear(void);
39
40 int mac_selinux_bind(int fd, const struct sockaddr *addr, socklen_t addrlen);
41 #endif // 0
42
43 DEFINE_TRIVIAL_CLEANUP_FUNC(char*, mac_selinux_free);