-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
}
#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
}
#ifdef HAVE_SELINUX
- if (!set_selinux_context(path))
+ if (!set_selinux_context(path, S_IFBLK))
return 0;
#endif
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@