]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/lsm/nop.c
github: Update for main branch
[mirror_lxc.git] / src / lxc / lsm / nop.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2
3 #include "config.h"
4
5 #include <stdlib.h>
6
7 #include "lsm/lsm.h"
8
9 static char *nop_process_label_get(struct lsm_ops *ops, pid_t pid)
10 {
11 return NULL;
12 }
13
14 static char *nop_process_label_get_at(struct lsm_ops *ops, int fd_pid)
15 {
16 return NULL;
17 }
18
19 static int nop_process_label_set(struct lsm_ops *ops, const char *label, struct lxc_conf *conf,
20 bool on_exec)
21 {
22 return 0;
23 }
24
25 static int nop_enabled(struct lsm_ops *ops)
26 {
27 return 0;
28 }
29
30 static int nop_keyring_label_set(struct lsm_ops *ops, const char *label)
31 {
32 return 0;
33 }
34
35 static int nop_prepare(struct lsm_ops *ops, struct lxc_conf *conf, const char *lxcpath)
36 {
37 return 0;
38 }
39
40 static void nop_cleanup(struct lsm_ops *ops, struct lxc_conf *conf, const char *lxcpath)
41 {
42 }
43
44 static int nop_process_label_fd_get(struct lsm_ops *ops, pid_t pid, bool on_exec)
45 {
46 return 0;
47 }
48
49 static int nop_process_label_set_at(struct lsm_ops *ops, int label_fd, const char *label, bool on_exec)
50 {
51 return 0;
52 }
53
54 static struct lsm_ops nop_ops = {
55 .name = "nop",
56 .aa_admin = -1,
57 .aa_can_stack = -1,
58 .aa_enabled = -1,
59 .aa_is_stacked = -1,
60 .aa_mount_features_enabled = -1,
61 .aa_parser_available = -1,
62 .aa_supports_unix = -1,
63 .cleanup = nop_cleanup,
64 .enabled = nop_enabled,
65 .keyring_label_set = nop_keyring_label_set,
66 .prepare = nop_prepare,
67 .process_label_fd_get = nop_process_label_fd_get,
68 .process_label_get = nop_process_label_get,
69 .process_label_set = nop_process_label_set,
70 .process_label_get_at = nop_process_label_get_at,
71 .process_label_set_at = nop_process_label_set_at,
72 };
73
74 struct lsm_ops *lsm_nop_ops_init(void)
75 {
76 return &nop_ops;
77 }