]> git.proxmox.com Git - mirror_lxc.git/blame - src/lxc/lsm/lsm.h
always ensure a /proc while setting up container
[mirror_lxc.git] / src / lxc / lsm / lsm.h
CommitLineData
fe4de9a6
DE
1/*
2 * lxc: linux Container library
3 *
4 * Copyright © 2013 Oracle.
5 *
6 * Authors:
7 * Dwight Engen <dwight.engen@oracle.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#ifndef __lxc_lsm_h
25#define __lxc_lsm_h
26
27struct lxc_conf;
28
29#include <sys/types.h>
30
31struct lsm_drv {
32 const char *name;
33
9e4bf8b1 34 int (*enabled)(void);
fe4de9a6 35 char *(*process_label_get)(pid_t pid);
72863294
DE
36 int (*process_label_set)(const char *label, int use_default,
37 int on_exec);
fe4de9a6
DE
38};
39
40#if HAVE_APPARMOR || HAVE_SELINUX
41ca8908
DE
41void lsm_init(void);
42int lsm_enabled(void);
43const char *lsm_name(void);
44char *lsm_process_label_get(pid_t pid);
72863294 45int lsm_process_label_set(const char *label, int use_default, int on_exec);
fe4de9a6 46#else
41ca8908
DE
47static inline void lsm_init(void) { }
48static inline int lsm_enabled(void) { return 0; }
49static inline const char *lsm_name(void) { return "none"; }
50static inline char *lsm_process_label_get(pid_t pid) { return NULL; }
6c1b2b1d 51static inline int lsm_process_label_set(const char *label, int use_default, int on_exec) { return 0; }
fe4de9a6
DE
52#endif
53
54#endif