]> sourceware.org Git - dm.git/commitdiff
Use matchpathcon mode parameter v1_01_03
authorAlasdair Kergon <agk@redhat.com>
Mon, 13 Jun 2005 13:11:47 +0000 (13:11 +0000)
committerAlasdair Kergon <agk@redhat.com>
Mon, 13 Jun 2005 13:11:47 +0000 (13:11 +0000)
VERSION
WHATS_NEW
lib/ioctl/libdm-iface.c
lib/libdm-common.c
lib/libdm-common.h.in

diff --git a/VERSION b/VERSION
index 534ec1df82ec6a701b1535f7e2e7b4df989b8973..960f654fb41bbc32da42e4d7363c0be550f77c5c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.01.03-cvs (2005-06-10)
+1.01.03-cvs (2005-06-13)
index d47a653dd5aa0d6ef74343cbdc9c4f49a9990b15..cca2e24fb3998a81901eab540b185149b384b547 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
-Version 1.01.03 - 10 Jun 2005
+Version 1.01.03 - 13 Jun 2005
 =============================
+  Use matchpathcon mode parameter.
   Fix configure script to re-enable selinux.
 
 Version 1.01.02 - 17 May 2005
index 471ca851a1c2bbdb1428ec9181a000f594fefe85..cd1cd6f09d64e2264ca1acaec1e95b3f3076e20f 100644 (file)
@@ -219,7 +219,7 @@ static int _create_control(const char *control, uint32_t major, uint32_t minor)
        }
 
 #ifdef HAVE_SELINUX
-        if (!set_selinux_context(control)) {
+        if (!set_selinux_context(control, S_IFCHR)) {
                 stack;
                 return 0;
         }
index 7f50fa25535f4e5d8e9d8cf8a9fe1673b439baf5..f08ae663067dfc7b4ac540d10afc03f2bebcbaf3 100644 (file)
@@ -200,27 +200,28 @@ int dm_task_add_target(struct dm_task *dmt, uint64_t start, uint64_t size,
 }
 
 #ifdef HAVE_SELINUX
-int set_selinux_context(const char *path)
+int set_selinux_context(const char *path, mode_t mode)
 {
        security_context_t scontext;
 
        if (is_selinux_enabled() <= 0)
                return 1;
 
-       if (matchpathcon(path, 0, &scontext) < 0) {
-               log_error("%s: matchpathcon failed: %s", path, strerror(errno));
+       if (matchpathcon(path, mode, &scontext) < 0) {
+               log_error("%s: matchpathcon %07o failed: %s", path, mode,
+                         strerror(errno));
                return 0;
        }
 
-       log_debug("Setting SELinux context for %s to %s", path, scontext);
+       log_debug("Setting SELinux context for %s to %s.", path, scontext);
 
        if ((lsetfilecon(path, scontext) < 0) && (errno != ENOTSUP)) {
                log_error("%s: lsetfilecon failed: %s", path, strerror(errno));
-               free(scontext);
+               freecon(scontext);
                return 0;
        }
 
-       free(scontext);
+       freecon(scontext);
        return 1;
 }
 #endif
@@ -266,7 +267,7 @@ static int _add_dev_node(const char *dev_name, uint32_t major, uint32_t minor,
        }
 
 #ifdef HAVE_SELINUX
-       if (!set_selinux_context(path))
+       if (!set_selinux_context(path, S_IFBLK))
                return 0;
 #endif
 
index 5129e45766b986ca637ce6dbcb9c7341c0ae512e..c2ae54380d13ffd4ef4860e5c659c1a33afc292c 100644 (file)
@@ -28,7 +28,7 @@ int rm_dev_node(const char *dev_name);
 int rename_dev_node(const char *old_name, const char *new_name);
 void update_devs(void);
 
-int set_selinux_context(const char *path);
+int set_selinux_context(const char *path, mode_t mode);
 
 #define DM_LIB_VERSION @DM_LIB_VERSION@
 
This page took 0.032431 seconds and 5 git commands to generate.