summaryrefslogtreecommitdiffstats
path: root/libdm/libdm-common.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2010-12-13 12:30:04 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2010-12-13 12:30:04 +0000
commitcb12e3fc9fd793a2aa5ad1f127d600e27ee5fe42 (patch)
tree3946b47fddea96b5a7f110f666799a43a4138cef /libdm/libdm-common.c
parentc0920fbf2a42988643d4238bec5dc91dc83fca25 (diff)
downloadlvm2-cb12e3fc9fd793a2aa5ad1f127d600e27ee5fe42.tar.gz
lvm2-cb12e3fc9fd793a2aa5ad1f127d600e27ee5fe42.tar.xz
lvm2-cb12e3fc9fd793a2aa5ad1f127d600e27ee5fe42.zip
#ifdef HAVE_SELINUX and #ifdef HAVE_SELINUX_LABEL_H
Diffstat (limited to 'libdm/libdm-common.c')
-rw-r--r--libdm/libdm-common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index d3f0d2a0..6ab3172e 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -390,6 +390,7 @@ int dm_task_add_target(struct dm_task *dmt, uint64_t start, uint64_t size,
static int _selabel_lookup(const char *path, mode_t mode,
security_context_t *scontext)
{
+#ifdef HAVE_SELINUX
#ifdef HAVE_SELINUX_LABEL_H
if (!_selabel_handle &&
!(_selabel_handle = selabel_open(SELABEL_CTX_FILE, NULL, 0))) {
@@ -401,12 +402,13 @@ static int _selabel_lookup(const char *path, mode_t mode,
log_error("selabel_lookup failed: %s", strerror(errno));
return 0;
}
-#elif HAVE_SELINUX
+#else
if (matchpathcon(path, mode, scontext)) {
log_error("matchpathcon failed: %s", strerror(errno));
return 0;
}
#endif
+#endif
return 1;
}