summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSteve Lawrence <slawrence@tresys.com>2010-08-30 16:32:30 -0400
committerPanu Matilainen <pmatilai@redhat.com>2010-09-01 09:30:51 +0300
commit34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd (patch)
treee58f17ba0e83e9a17c88f6ba77380ff30e48c0cc /configure.ac
parent383e27564853fd4c387ca1d4a69f223140a0daca (diff)
downloadlibrpm-tizen-34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd.tar.gz
librpm-tizen-34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd.tar.bz2
librpm-tizen-34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd.zip
Use selabel interfaces instead of matchpathcon
This replaces the old matchpathcon interfaces with the new selabel interfaces for relabeling files, storing an selabel handle in the transaction set. With this change, also comes an added distinction between --nocontexts being specified and a failure to read the load file contexts. Previously, there was no distinction, and both cases used the RPMTRANS_FLAG_NOCONTEXTS flag. However, with the new policy plugin, it is necessary to make such a distinction. This is because matchpathcon_init (now selabel interfaces) can fail at the beginning of the transaction, but succeed later after new policy is installed. Because of this, we may need to enable/disable RPMTRANS_FLAG_NOCONTEXTS multiple times. However, because this flag could also mean --nocontexts, we cannot do that. By storing the selabel handle in the rpmts, we can easily keep track if the handle has been successfully created, rather than overloading RPMTRANS_FLAG_NOCONTEXTS with two meanings.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a33d8be48..c593b6c17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -577,6 +577,19 @@ AS_IF([test "$with_selinux" = yes],[
],[
AC_MSG_ERROR([--with-selinux given, but selinux/selinux.h not found])
])
+
+ AC_CHECK_HEADER([selinux/label.h],[
+ save_LIBS="$LIBS"
+ AC_CHECK_LIB([selinux],[selabel_close],[],[
+ AC_MSG_ERROR([--with-selinux given, but selabel_close not found in libselinux])])
+ AC_CHECK_LIB([selinux],[selabel_lookup_raw],[],[
+ AC_MSG_ERROR([--with-selinux given, but selabel_lookup_raw not found in libselinux])])
+ AC_CHECK_LIB([selinux],[selabel_open],[],[
+ AC_MSG_ERROR([--with-selinux given, but selabel_open not found in libselinux])])
+ LIBS="$save_LIBS"
+ ],[
+ AC_MSG_ERROR([--with-selinux given, but selinux/label.h not found])
+ ])
])
AS_IF([test "$with_selinux" = yes],[