X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udev_selinux.c;h=94c213d297aca46c0d3927709db2789119bb57fc;hp=cc6f4d7d3fad6716d468315993199afe67399887;hb=ff9a488d8c559a2ee40e522cdc68b750670711e4;hpb=4d7726399bcaf74105f8f3c27ee37b5dbddc1fee diff --git a/udev_selinux.c b/udev_selinux.c index cc6f4d7d3..94c213d29 100644 --- a/udev_selinux.c +++ b/udev_selinux.c @@ -30,8 +30,8 @@ #include #include +#include "udev.h" #include "udev_selinux.h" -#include "logging.h" static security_context_t prev_scontext = NULL; @@ -100,12 +100,12 @@ void selinux_setfilecon(const char *file, const char *devname, unsigned int mode if (ret < 0) if (matchpathcon(file, mode, &scontext) < 0) { - dbg("matchpathcon(%s) failed\n", file); + err("matchpathcon(%s) failed\n", file); return; } if (setfilecon(file, scontext) < 0) - dbg("setfilecon %s failed with error '%s'", file, strerror(errno)); + err("setfilecon %s failed: %s", file, strerror(errno)); freecon(scontext); } @@ -126,12 +126,12 @@ void selinux_setfscreatecon(const char *file, const char *devname, unsigned int if (ret < 0) if (matchpathcon(file, mode, &scontext) < 0) { - dbg("matchpathcon(%s) failed\n", file); + err("matchpathcon(%s) failed\n", file); return; } if (setfscreatecon(scontext) < 0) - dbg("setfscreatecon %s failed with error '%s'", file, strerror(errno)); + err("setfscreatecon %s failed: %s", file, strerror(errno)); freecon(scontext); } @@ -141,7 +141,7 @@ void selinux_resetfscreatecon(void) { if (is_selinux_running()) { if (setfscreatecon(prev_scontext) < 0) - dbg("setfscreatecon %s failed with error '%s'", file, strerror(errno)); + err("setfscreatecon failed: %s", strerror(errno)); } } @@ -152,8 +152,9 @@ void selinux_init(void) * restoration creation purposes. */ if (is_selinux_running()) { + matchpathcon_init_prefix(NULL, udev_root); if (getfscreatecon(&prev_scontext) < 0) { - dbg("getfscreatecon failed\n"); + err("getfscreatecon failed\n"); prev_scontext = NULL; } }