]> git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/apparmor.h
free kernel_subsystems in success case
[mirror_lxc.git] / src / lxc / apparmor.h
1 /* apparmor
2 *
3 * Copyright © 2012 Serge Hallyn <serge.hallyn@ubuntu.com>.
4 * Copyright © 2012 Canonical Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <lxc/start.h> /* for lxc_handler */
22 #include <lxc/conf.h>
23
24 struct lxc_handler;
25
26 /*
27 * apparmor_handler_init is really just a wrapper around check_apparmor_enabled
28 * to allow us to keep from having #ifdef APPARMOR in start.c
29 */
30 extern void apparmor_handler_init(struct lxc_handler *handler);
31
32 #if HAVE_APPARMOR
33 extern char *aa_get_profile(pid_t pid);
34 extern int do_apparmor_load(int aa_enabled, char *aa_profile,
35 int umount_proc, int dropprivs);
36 extern int apparmor_load(struct lxc_handler *handler);
37 extern int attach_apparmor(char *profile);
38 extern int lsm_mount_proc_if_needed(char *root_src, char *rootfs_tgt);
39 #else
40 static inline char *aa_get_profile(pid_t pid) {
41 return NULL;
42 }
43 static inline int do_apparmor_load(int aa_enabled, char *aa_profile,
44 int umount_proc, int dropprivs) {
45 return 0;
46 }
47 static inline int attach_apparmor(char *profile) {
48 return 0;
49 }
50 static inline int apparmor_load(struct lxc_handler *handler) {
51 return 0;
52 }
53 static inline int lsm_mount_proc_if_needed(char *root_src, char *rootfs_tgt) {
54 return 0;
55 }
56 #endif