]> git.ipfire.org Git - thirdparty/glibc.git/blame - nscd/selinux.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / nscd / selinux.h
CommitLineData
74a30a58 1/* Header for nscd SELinux access controls.
04277e02 2 Copyright (C) 2004-2019 Free Software Foundation, Inc.
74a30a58
UD
3 This file is part of the GNU C Library.
4 Contributed by Matthew Rickard <mjricka@epoch.ncsc.mil>, 2004.
5
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.
10
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.
15
16 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
74a30a58
UD
19
20#ifndef _SELINUX_H
21#define _SELINUX_H 1
22
23#include "nscd.h"
1f063dca 24#ifdef HAVE_LIBCAP
e1f0c5bc 25# include <sys/capability.h>
1f063dca 26#endif
74a30a58
UD
27
28#ifdef HAVE_SELINUX
29/* Global variable to tell if the kernel has SELinux support. */
30extern int selinux_enabled;
31
32/* Define this for AVC stat usage. */
33struct avc_cache_stats;
34
35/* Initialize the userspace AVC. */
36extern void nscd_avc_init (void);
74a30a58
UD
37/* Determine if we are running on an SELinux kernel. */
38extern void nscd_selinux_enabled (int *selinux_enabled);
39/* Check if the client has permission for the request type. */
40extern int nscd_request_avc_has_perm (int fd, request_type req);
41/* Initialize AVC statistic information. */
42extern void nscd_avc_cache_stats (struct avc_cache_stats *cstats);
43/* Display statistics on AVC usage. */
44extern void nscd_avc_print_stats (struct avc_cache_stats *cstats);
1f063dca
UD
45
46# ifdef HAVE_LIBCAP
795934a6 47/* Preserve capabilities to connect to the audit daemon. */
1f063dca
UD
48extern cap_t preserve_capabilities (void);
49/* Install final capabilities. */
50extern void install_real_capabilities (cap_t new_caps);
51# endif
74a30a58
UD
52#else
53# define selinux_enabled 0
54# define nscd_avc_init() (void) 0
74a30a58
UD
55# define nscd_selinux_enabled(selinux_enabled) (void) 0
56# define nscd_request_avc_has_perm(fd, req) 0
57# define nscd_avc_cache_stats(cstats) (void) 0
58# define nscd_avc_print_stats(cstats) (void) 0
59#endif /* HAVE_SELINUX */
60
61#endif /* _SELINUX_H */