diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 4cbf50070..314b0398c 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.39 - ===================================== + Make libdm ABI consistent when built with/without selinux support. Version 1.02.38 - 25th September 2009 ===================================== diff --git a/lib/activate/fs.c b/lib/activate/fs.c index e412cffc5..6e4f91a9e 100644 --- a/lib/activate/fs.c +++ b/lib/activate/fs.c @@ -201,10 +201,8 @@ static int _mk_link(const char *dev_dir, const char *vg_name, return 0; } -#ifdef HAVE_SELINUX if (!dm_set_selinux_context(lv_path, S_IFLNK)) return_0; -#endif return 1; } diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index 175d8d1d9..248d3ac75 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -373,9 +373,9 @@ int dm_task_add_target(struct dm_task *dmt, uint64_t start, uint64_t size, return 1; } -#ifdef HAVE_SELINUX int dm_set_selinux_context(const char *path, mode_t mode) { +#ifdef HAVE_SELINUX security_context_t scontext; if (is_selinux_enabled() <= 0) @@ -396,9 +396,9 @@ int dm_set_selinux_context(const char *path, mode_t mode) } freecon(scontext); +#endif return 1; } -#endif static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor, uid_t uid, gid_t gid, mode_t mode) @@ -445,10 +445,8 @@ static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor, log_debug("Created %s", path); -#ifdef HAVE_SELINUX if (!dm_set_selinux_context(path, S_IFBLK)) return 0; -#endif return 1; }