bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] install runs faster again with SELinux enabled


From: Jim Meyering
Subject: Re: [PATCH] install runs faster again with SELinux enabled
Date: Tue, 04 Aug 2009 16:59:04 +0200

Kamil Dudka wrote:
> as solution to rhbz #479502 I propose the enclosed patch. The optimization
> based on matchpathcon_init_prefix () function is now turned off by broken
> configure script - it does not see the function because of lack of -lselinux.
> Moreover the patch emits configure warning while the function is not found and
> SELinux enabled. The performance impact is huge.

Hi Kamil,

Thanks for the bug fix!

I've pushed that after adjusting both NEWS and the log to mention
when the bug was introduced:

>From 1762092901adf040445d59931d14837ef7f2ebe1 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <address@hidden>
Date: Tue, 4 Aug 2009 16:21:08 +0200
Subject: [PATCH] install runs faster again with SELinux enabled

* m4/jm-macros.m4: Pull in SELinux libraries while checking for
matchpathcon_init_prefix ().  Emit configure warning when not found
with SELinux enabled.
* NEWS (Bug fixes): Mention it.
The bug was introduced in coreutils-7.0 via commit 0647f3eb, 2008-06-02,
"accommodate older SELinux which lacks matchpathcon_init_prefix".
---
 NEWS            |    3 +++
 m4/jm-macros.m4 |   16 +++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index 80c60e2..5058b57 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ GNU coreutils NEWS                                    -*- 
outline -*-

 ** Bug fixes

+  install runs faster again with SELinux enabled
+  [introduced in coreutils-7.0]
+
   ls -1U (with two or more arguments, at least one a nonempty directory)
   would print entry names *before* the name of the containing directory.
   Also fixed incorrect output of ls -1RU and ls -1sU.
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index f14d6a3..f862984 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -47,7 +47,21 @@ AC_DEFUN([coreutils_MACROS],
   AC_CHECK_FUNCS_ONCE([directio])

   # Used by install.c.
-  AC_CHECK_FUNCS_ONCE([matchpathcon_init_prefix])
+  coreutils_saved_libs=$LIBS
+    LIBS="$LIBS $LIB_SELINUX"
+    AC_CHECK_FUNCS([matchpathcon_init_prefix], [],
+    [
+      case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in
+       no:*) # SELinux disabled
+         ;;
+       *:no) # SELinux disabled
+         ;;
+       *)
+       AC_MSG_WARN([SELinux enabled, but matchpathcon_init_prefix not found])
+       AC_MSG_WARN([The install utility may run slowly])
+      esac
+    ])
+  LIBS=$coreutils_saved_libs

   # Used by sort.c.
   AC_CHECK_FUNCS_ONCE([nl_langinfo])
--
1.6.4.70.g9c084




reply via email to

[Prev in Thread] Current Thread [Next in Thread]