From 74a30a5851087f40ff53f2716374c8870cd4a48a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 17 Sep 2004 00:04:18 +0000 Subject: Update. 2004-09-16 Ulrich Drepper * configure.in: Add test for required SELinux features. * config.make.in: Add have-selinux entry. * config.h.in: Add HAVE_SELINUX entry. * nscd/Makefile (nscd-modules): Add selinux. (CFLAGS-selinux.c): Add -fpie. Define selinux-LIBS and use in link line. * nscd/connections.c (handle_request): Check access SELinux permissions before processing request. * nscd/nscd.c (main): Initialize selinux_enabled and stop avc thread. * nscd/nscd_stat.c: Transmit and print AVC statistics. * nscd/selinux.c: New file. * nscd/selinux.h: New file. 2004-09-16 Jakub Jelinek * nscd/nscd_helper.c (__nscd_unmap, get_mapping): Use __munmap instead of munmap. * nscd/Makefile (CFLAGS-aicache.c): Set to -fpie. 2004-09-16 Thorsten Kukuk * sysdeps/posix/getaddrinfo.c (gaih_inet): Check __nss_not_use_nscd_hosts variable if nscd should be used or not. 2004-09-16 Ulrich Drepper * nscd/nscd_proto.h: Define NSS_NSCD_RETRY. Add __nscd_getai prototype. * nss/getXXbyYY_r.c: Remode definition of NSS_NSCD_RETRY. * nscd/nscd-client.h: Remove __nscd_getai prototype. * nscd/nscd_getai.c: Include nscd_proto.h. * elf/ldd.bash.in: Add support for SELinux environments. Patch by Stephen Smalley . --- nscd/nscd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nscd/nscd.c') diff --git a/nscd/nscd.c b/nscd/nscd.c index facea5ecdb..b0e7a20947 100644 --- a/nscd/nscd.c +++ b/nscd/nscd.c @@ -44,6 +44,7 @@ #include "dbg_log.h" #include "nscd.h" +#include "selinux.h" #include "../nss/nsswitch.h" #include @@ -126,6 +127,9 @@ main (int argc, char **argv) /* Set the text message domain. */ textdomain (PACKAGE); + /* Determine if the kernel has SELinux support. */ + nscd_selinux_enabled (&selinux_enabled); + /* Parse and process arguments. */ argp_parse (&argp, argc, argv, 0, &remaining, NULL); @@ -244,6 +248,10 @@ main (int argc, char **argv) signal (SIGTSTP, SIG_IGN); } + /* Start the SELinux AVC. */ + if (selinux_enabled) + nscd_avc_init (); + signal (SIGINT, termination_handler); signal (SIGQUIT, termination_handler); signal (SIGTERM, termination_handler); @@ -421,6 +429,10 @@ termination_handler (int signum) // XXX async OK? msync (dbs[cnt].head, dbs[cnt].memsize, MS_ASYNC); + /* Shutdown the SELinux AVC. */ + if (selinux_enabled) + nscd_avc_destroy (); + _exit (EXIT_SUCCESS); } -- cgit 1.4.1