char *media;
int ret = -1;
- media = get_media(devname, mode);
- if (media) {
- ret = matchmediacon(media, &scontext);
- free(media);
+ if (devname) {
+ media = get_media(devname, mode);
+ if (media) {
+ ret = matchmediacon(media, &scontext);
+ free(media);
+ }
}
if (ret < 0)
* restoration creation purposes.
*/
if (is_selinux_running()) {
+ if (!udev_root[0])
+ err("selinux_init: udev_root not set\n");
matchpathcon_init_prefix(NULL, udev_root);
if (getfscreatecon(&prev_scontext) < 0) {
err("getfscreatecon failed\n");