diff --git a/init/init.cpp b/init/init.cpp index 4e462d7f9419ae5d65e3fc0cfcb5be74f77e87d7..999fadad75a1151e7193abd145595ed6128144a9 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -880,7 +880,6 @@ static void selinux_restore_context() { selinux_android_restorecon("/dev/__properties__", 0); selinux_android_restorecon("/plat_property_contexts", 0); selinux_android_restorecon("/nonplat_property_contexts", 0); - selinux_android_restorecon("/sys", SELINUX_ANDROID_RESTORECON_RECURSE); selinux_android_restorecon("/dev/block", SELINUX_ANDROID_RESTORECON_RECURSE); selinux_android_restorecon("/dev/device-mapper", 0); diff --git a/init/uevent_listener.cpp b/init/uevent_listener.cpp index 01b825071eb85a44b133a139ef5dfcf9a6977caa..27c5d23740614223461bf3d09fd6ed7afe96330f 100644 --- a/init/uevent_listener.cpp +++ b/init/uevent_listener.cpp @@ -165,7 +165,7 @@ RegenerationAction UeventListener::RegenerateUeventsForPath(const std::string& p return RegenerateUeventsForDir(d.get(), callback); } -const char* kRegenerationPaths[] = {"/sys/class", "/sys/block", "/sys/devices"}; +static const char* kRegenerationPaths[] = {"/sys/class", "/sys/block", "/sys/devices"}; void UeventListener::RegenerateUevents(RegenerateCallback callback) const { for (const auto path : kRegenerationPaths) { diff --git a/init/uevent_listener.h b/init/uevent_listener.h index 8e6f3b40b5d84975abced4d607345d325939007b..ba31aaa718a35f1df48a0e9390155b8e133040c1 100644 --- a/init/uevent_listener.h +++ b/init/uevent_listener.h @@ -35,8 +35,6 @@ enum class RegenerationAction { using RegenerateCallback = std::function; using PollCallback = std::function; -extern const char* kRegenerationPaths[3]; - class UeventListener { public: UeventListener(); diff --git a/init/ueventd.cpp b/init/ueventd.cpp index 31e41065b21b662bfcb3fda581b841953da6f1df..d12164719009c612b3ca82ab3f9cde1901f5d91f 100644 --- a/init/ueventd.cpp +++ b/init/ueventd.cpp @@ -174,9 +174,7 @@ void ColdBoot::ForkSubProcesses() { } void ColdBoot::DoRestoreCon() { - for (const char* path : kRegenerationPaths) { - selinux_android_restorecon(path, SELINUX_ANDROID_RESTORECON_RECURSE); - } + selinux_android_restorecon("/sys", SELINUX_ANDROID_RESTORECON_RECURSE); device_handler_.set_skip_restorecon(false); }