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