Loading init/host_init_stubs.h +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ // android/api-level.h #define __ANDROID_API_P__ 28 #define __ANDROID_API_Q__ 29 #define __ANDROID_API_R__ 30 // sys/system_properties.h Loading init/service_parser.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -560,6 +560,11 @@ Result<void> ServiceParser::ParseSection(std::vector<std::string>&& args, str_args[0] = "/system/bin/watchdogd"; } } if (SelinuxGetVendorAndroidVersion() <= __ANDROID_API_Q__) { if (str_args[0] == "/charger") { str_args[0] = "/system/bin/charger"; } } service_ = std::make_unique<Service>(name, restart_action_subcontext, str_args); return {}; Loading init/util_test.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,8 @@ TEST(util, ReadFileWorldWiteable) { TEST(util, ReadFileSymbolicLink) { errno = 0; // lrwxrwxrwx 1 root root 13 1970-01-01 00:00 charger -> /sbin/healthd auto file_contents = ReadFile("/charger"); // lrw------- 1 root root 23 2008-12-31 19:00 default.prop -> system/etc/prop.default auto file_contents = ReadFile("/default.prop"); EXPECT_EQ(ELOOP, errno); ASSERT_FALSE(file_contents); EXPECT_EQ("open() failed: Too many symbolic links encountered", Loading Loading
init/host_init_stubs.h +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ // android/api-level.h #define __ANDROID_API_P__ 28 #define __ANDROID_API_Q__ 29 #define __ANDROID_API_R__ 30 // sys/system_properties.h Loading
init/service_parser.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -560,6 +560,11 @@ Result<void> ServiceParser::ParseSection(std::vector<std::string>&& args, str_args[0] = "/system/bin/watchdogd"; } } if (SelinuxGetVendorAndroidVersion() <= __ANDROID_API_Q__) { if (str_args[0] == "/charger") { str_args[0] = "/system/bin/charger"; } } service_ = std::make_unique<Service>(name, restart_action_subcontext, str_args); return {}; Loading
init/util_test.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,8 @@ TEST(util, ReadFileWorldWiteable) { TEST(util, ReadFileSymbolicLink) { errno = 0; // lrwxrwxrwx 1 root root 13 1970-01-01 00:00 charger -> /sbin/healthd auto file_contents = ReadFile("/charger"); // lrw------- 1 root root 23 2008-12-31 19:00 default.prop -> system/etc/prop.default auto file_contents = ReadFile("/default.prop"); EXPECT_EQ(ELOOP, errno); ASSERT_FALSE(file_contents); EXPECT_EQ("open() failed: Too many symbolic links encountered", Loading