]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
accommodate older SELinux which lacks matchpathcon_init_prefix
authorJim Meyering <meyering@redhat.com>
Mon, 2 Jun 2008 19:17:57 +0000 (21:17 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 2 Jun 2008 19:34:40 +0000 (21:34 +0200)
* m4/jm-macros.m4: Check for matchpathcon_init_prefix.
* src/install.c [!HAVE_MATCHPATHCON_INIT_PREFIX]
(matchpathcon_init_prefix): Define away.
* gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.
Reported by Ilya N. Golubev in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13686>.

THANKS
gl/lib/se-selinux.in.h
m4/jm-macros.m4
src/install.c

diff --git a/THANKS b/THANKS
index df84761585fa87e4c30225462a7dc6fdbfc43a05..feaf463325d186e155facc187333585ad57597fe 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -220,6 +220,7 @@ Ian Jackson                         ijackson@chiark.greenend.org.uk
 Ian Lance Taylor                    ian@cygnus.com
 Ian Turner                          vectro@pipeline.com
 Iida Yosiaki                        iida@gnu.org
+Ilya N. Golubev                     gin@mo.msk.ru
 Ingo Saitz                          ingo@debian.org
 Ivo Timmermans                      ivo@debian.org
 James                               james@albion.glarp.com
index 7be1e702a7c874d97b7eb0cf5ff6996bad10e80a..ac421c38a34251221a4b09ceeb8af6170646268a 100644 (file)
@@ -17,7 +17,8 @@ typedef unsigned short security_class_t;
 # define security_context_t char*
 # define is_selinux_enabled() 0
 
-static inline int getcon (security_context_t *con) { errno = ENOTSUP; return -1; }
+static inline int getcon (security_context_t *con)
+  { errno = ENOTSUP; return -1; }
 static inline void freecon (security_context_t con) {}
 
 
@@ -28,7 +29,9 @@ static inline int setfscreatecon (security_context_t con)
 static inline int matchpathcon (char const *s, mode_t m,
                                security_context_t *con)
   { errno = ENOTSUP; return -1; }
-
+static inline int matchpathcon_init_prefix (const char *path,
+                                           const char *prefix)
+  { errno = ENOTSUP; return -1; }
 static inline int getfilecon (char const *s, security_context_t *con)
   { errno = ENOTSUP; return -1; }
 static inline int lgetfilecon (char const *s, security_context_t *con)
index 5a92d4a9e90354855352b2f1179dccd443cf5351..cf1f2f00366ef27ea014cc4904e84d2616374a70 100644 (file)
@@ -2,7 +2,7 @@
 
 dnl Misc type-related macros for coreutils.
 
-# Copyright (C) 1998, 2000-2007 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000-2008 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -46,6 +46,9 @@ AC_DEFUN([coreutils_MACROS],
   # used by shred
   AC_CHECK_FUNCS_ONCE(directio)
 
+  # Used by install.c.
+  AC_CHECK_FUNCS_ONCE([matchpathcon_init_prefix])
+
   AC_CHECK_FUNCS_ONCE( \
     endgrent \
     endpwent \
index 1d902d6ee451d38311278e654b472e3a7939db39..decdd7d36b29d3935d938afce168a540b1accd8b 100644 (file)
@@ -66,6 +66,10 @@ static bool use_default_selinux_context = true;
 # define lchown(name, uid, gid) chown (name, uid, gid)
 #endif
 
+#if ! HAVE_MATCHPATHCON_INIT_PREFIX
+# define matchpathcon_init_prefix(a, p) /* empty */
+#endif
+
 /* Initial number of entries in each hash table entry's table of inodes.  */
 #define INITIAL_HASH_MODULE 100