Don't try to cleanup libselinux and libaudit.
[glibc.git] / nscd / selinux.h
blob67d981bb06de59941f855fa6aad71eff1b7f666e
1 /* Header for nscd SELinux access controls.
2 Copyright (C) 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Matthew Rickard <mjricka@epoch.ncsc.mil>, 2004.
6 The GNU C 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.
11 The GNU C 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.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 #ifndef _SELINUX_H
22 #define _SELINUX_H 1
24 #include "nscd.h"
25 #ifdef HAVE_LIBCAP
26 # include <sys/capability.h>
27 #endif
29 #ifdef HAVE_SELINUX
30 /* Global variable to tell if the kernel has SELinux support. */
31 extern int selinux_enabled;
33 /* Define this for AVC stat usage. */
34 struct avc_cache_stats;
36 /* Initialize the userspace AVC. */
37 extern void nscd_avc_init (void);
38 /* Determine if we are running on an SELinux kernel. */
39 extern void nscd_selinux_enabled (int *selinux_enabled);
40 /* Check if the client has permission for the request type. */
41 extern int nscd_request_avc_has_perm (int fd, request_type req);
42 /* Initialize AVC statistic information. */
43 extern void nscd_avc_cache_stats (struct avc_cache_stats *cstats);
44 /* Display statistics on AVC usage. */
45 extern void nscd_avc_print_stats (struct avc_cache_stats *cstats);
47 # ifdef HAVE_LIBCAP
48 /* Preserve capabilities to connect to connnect to the audit daemon. */
49 extern cap_t preserve_capabilities (void);
50 /* Install final capabilities. */
51 extern void install_real_capabilities (cap_t new_caps);
52 # endif
53 #else
54 # define selinux_enabled 0
55 # define nscd_avc_init() (void) 0
56 # define nscd_selinux_enabled(selinux_enabled) (void) 0
57 # define nscd_request_avc_has_perm(fd, req) 0
58 # define nscd_avc_cache_stats(cstats) (void) 0
59 # define nscd_avc_print_stats(cstats) (void) 0
60 #endif /* HAVE_SELINUX */
62 #endif /* _SELINUX_H */