X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev_selinux.c;h=f014ea55359d6653950a419fd33827dff76e2cf9;hb=fb6e4c28248cdeed30a1d3eb42aba477f0429472;hp=cc6f4d7d3fad6716d468315993199afe67399887;hpb=4d7726399bcaf74105f8f3c27ee37b5dbddc1fee;p=elogind.git diff --git a/udev_selinux.c b/udev_selinux.c index cc6f4d7d3..f014ea553 100644 --- a/udev_selinux.c +++ b/udev_selinux.c @@ -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, "/dev"); if (getfscreatecon(&prev_scontext) < 0) { - dbg("getfscreatecon failed\n"); + err("getfscreatecon failed\n"); prev_scontext = NULL; } }