Merge "Move restorecon() of /sys from init to ueventd."
am: 2787894768
Change-Id: I45baa3ee95a630517ef94e1bca3d74637655abd9
This commit is contained in:
commit
432326ecbb
4 changed files with 2 additions and 7 deletions
|
|
@ -880,7 +880,6 @@ static void selinux_restore_context() {
|
||||||
selinux_android_restorecon("/dev/__properties__", 0);
|
selinux_android_restorecon("/dev/__properties__", 0);
|
||||||
selinux_android_restorecon("/plat_property_contexts", 0);
|
selinux_android_restorecon("/plat_property_contexts", 0);
|
||||||
selinux_android_restorecon("/nonplat_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/block", SELINUX_ANDROID_RESTORECON_RECURSE);
|
||||||
selinux_android_restorecon("/dev/device-mapper", 0);
|
selinux_android_restorecon("/dev/device-mapper", 0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ RegenerationAction UeventListener::RegenerateUeventsForPath(const std::string& p
|
||||||
return RegenerateUeventsForDir(d.get(), callback);
|
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 {
|
void UeventListener::RegenerateUevents(RegenerateCallback callback) const {
|
||||||
for (const auto path : kRegenerationPaths) {
|
for (const auto path : kRegenerationPaths) {
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ enum class RegenerationAction {
|
||||||
using RegenerateCallback = std::function<RegenerationAction(const Uevent&)>;
|
using RegenerateCallback = std::function<RegenerationAction(const Uevent&)>;
|
||||||
using PollCallback = std::function<void(const Uevent&)>;
|
using PollCallback = std::function<void(const Uevent&)>;
|
||||||
|
|
||||||
extern const char* kRegenerationPaths[3];
|
|
||||||
|
|
||||||
class UeventListener {
|
class UeventListener {
|
||||||
public:
|
public:
|
||||||
UeventListener();
|
UeventListener();
|
||||||
|
|
|
||||||
|
|
@ -174,9 +174,7 @@ void ColdBoot::ForkSubProcesses() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColdBoot::DoRestoreCon() {
|
void ColdBoot::DoRestoreCon() {
|
||||||
for (const char* path : kRegenerationPaths) {
|
selinux_android_restorecon("/sys", SELINUX_ANDROID_RESTORECON_RECURSE);
|
||||||
selinux_android_restorecon(path, SELINUX_ANDROID_RESTORECON_RECURSE);
|
|
||||||
}
|
|
||||||
device_handler_.set_skip_restorecon(false);
|
device_handler_.set_skip_restorecon(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue