about summary refs log tree commit diff
path: root/nscd/nscd.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-17 00:04:18 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-17 00:04:18 +0000
commit74a30a5851087f40ff53f2716374c8870cd4a48a (patch)
tree2ac1d833b6114746a43a48d3113ebf8d1df4b571 /nscd/nscd.c
parent2fff3d93b552dbddc406c41786ecfd0a1074b564 (diff)
downloadglibc-74a30a5851087f40ff53f2716374c8870cd4a48a.tar.gz
glibc-74a30a5851087f40ff53f2716374c8870cd4a48a.tar.xz
glibc-74a30a5851087f40ff53f2716374c8870cd4a48a.zip
Update.
2004-09-16  Ulrich Drepper  <drepper@redhat.com>

	* 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  <jakub@redhat.com>

	* 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  <kukuk@suse.de>

	* 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  <drepper@redhat.com>

	* 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 <sds@epoch.ncsc.mil>.
Diffstat (limited to 'nscd/nscd.c')
-rw-r--r--nscd/nscd.c12
1 files changed, 12 insertions, 0 deletions
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 <device-nrs.h>
 
@@ -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);
 }