Attempting to relabel /dev/console, /proc or /sys results in an error
message. Avoid that by excluding them when relabeling rootfs on boot.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
return 0;
}
/* Second call: restore filesystem labels */
- ret = selinux_restorecon("/", SELINUX_RESTORECON_RECURSE);
+ const char *exclude_list[] = { "/dev/console", "/proc", "/sys", 0 };
+ selinux_restorecon_set_exclude_list(exclude_list);
+ ret = selinux_restorecon("/", SELINUX_RESTORECON_RECURSE | SELINUX_RESTORECON_MASS_RELABEL);
putenv("SELINUX_RESTORECON=1");
} else {
/* First call: load policy */