]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't try to cleanup libselinux and libaudit.
authorJakub Jelinek <jakub@redhat.com>
Sat, 16 May 2009 03:48:08 +0000 (20:48 -0700)
committerPetr Baudis <pasky@suse.cz>
Fri, 22 May 2009 02:49:43 +0000 (04:49 +0200)
Because we are not shutting down the other threads first another
thread might work on a query before the process shuts down.  In this
case the now uninitialized libselinux and libaudit might be used.
Just don't free the resources.  It's not necessary anyway because
the process is about to terminate.
(cherry picked from commit 9e471dad8e173806cbbfb704875d5ae40e36fa34)
(fixed ChangeLog entry by pasky)

ChangeLog
nscd/nscd.c
nscd/selinux.c
nscd/selinux.h

index e3afa8543c3433bc41a447398d7eeafbe565bd56..3f41c66542977adb54b54f9fd0123c64da5d27dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-05-14  Jakub Jelinek  <jakub@redhat.com>
+
+       * nscd/selinux.c (nscd_avc_destroy): Removed.
+       * nscd/selinux.h (nscd_avc_destroy): Likewise.
+       * nscd/nscd.c (termination_handler): Don't call
+       nscd_avc_destroy.
+
 2009-05-10  Ulrich Drepper  <drepper@redhat.com>
 
        * version.h (VERSION): Bump to 2.10.1.
index 3265ea8973edc31056531bd18fe8d4d06dde331e..b9035f21310693f02c75a31e339c5ab7de2553d8 100644 (file)
@@ -488,10 +488,6 @@ termination_handler (int signum)
        msync (dbs[cnt].head, dbs[cnt].memsize, MS_ASYNC);
     }
 
-  /* Shutdown the SELinux AVC.  */
-  if (selinux_enabled)
-    nscd_avc_destroy ();
-
   _exit (EXIT_SUCCESS);
 }
 
index 9a167ec14d55bade779b44359c13ef68a9c2bf5b..e07a454bf8e80f69351a06dde498ad89144f1c0b 100644 (file)
@@ -1,5 +1,5 @@
 /* SELinux access controls for nscd.
-   Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Matthew Rickard <mjricka@epoch.ncsc.mil>, 2004.
 
@@ -418,15 +418,4 @@ nscd_avc_print_stats (struct avc_cache_stats *cstats)
          cstats->cav_probes, cstats->cav_misses);
 }
 
-
-/* Clean up the AVC before exiting.  */
-void
-nscd_avc_destroy (void)
-{
-  avc_destroy ();
-#ifdef HAVE_LIBAUDIT
-  audit_close (audit_fd);
-#endif
-}
-
 #endif /* HAVE_SELINUX */
index 27afcd6e86207546375f7d7b90e8f98faf096dba..67d981bb06de59941f855fa6aad71eff1b7f666e 100644 (file)
@@ -1,5 +1,5 @@
 /* Header for nscd SELinux access controls.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Matthew Rickard <mjricka@epoch.ncsc.mil>, 2004.
 
@@ -35,8 +35,6 @@ struct avc_cache_stats;
 
 /* Initialize the userspace AVC.  */
 extern void nscd_avc_init (void);
-/* Destroy the userspace AVC.  */
-extern void nscd_avc_destroy (void);
 /* Determine if we are running on an SELinux kernel.  */
 extern void nscd_selinux_enabled (int *selinux_enabled);
 /* Check if the client has permission for the request type.  */
@@ -55,7 +53,6 @@ extern void install_real_capabilities (cap_t new_caps);
 #else
 # define selinux_enabled 0
 # define nscd_avc_init() (void) 0
-# define nscd_avc_destroy() (void) 0
 # define nscd_selinux_enabled(selinux_enabled) (void) 0
 # define nscd_request_avc_has_perm(fd, req) 0
 # define nscd_avc_cache_stats(cstats) (void) 0