[dm-devel] [PATCH 1/3] devmapper - don't modify api on selinux support
Bastian Blank
bastian at waldi.eu.org
Mon Mar 10 20:02:27 UTC 2008
Always include dm_set_selinux_context in libdevmapper.
--- trunk.orig/lib/libdm-common.c
+++ trunk/lib/libdm-common.c
@@ -233,9 +233,9 @@
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)
@@ -256,9 +256,9 @@
}
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)
@@ -302,10 +302,8 @@
log_debug("Created %s", path);
-#ifdef HAVE_SELINUX
if (!dm_set_selinux_context(path, S_IFBLK))
return 0;
-#endif
return 1;
}
--
We fight only when there is no other choice. We prefer the ways of
peaceful contact.
-- Kirk, "Spectre of the Gun", stardate 4385.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20080310/772224f4/attachment.sig>
More information about the dm-devel
mailing list