From 9285b496bd4ec2c50694042609576b72c8a16a0b Mon Sep 17 00:00:00 2001 From: Boleyn Su Date: Fri, 26 Jun 2020 18:08:07 +0900 Subject: [PATCH] ReadFileSymbolicLink checks /system/bin/ps According to https://android.googlesource.com/platform/build/+/refs/heads/android10-dev/core/Makefile#140, /default.prop may not be a symbolic link. Bug: 158552949 Test: atest CtsInitTestCases Change-Id: I19bde577fa50280e1ed6fb8fdbe846655abb930b Merged-In: I0d3f96c1656dfe02bfa0e801680f7fa887afd1d9 (cherry picked from commit 6f47feaccdbe849c982e0de9068e38be85006bfb) (cherry picked from commit 755a3dd78d913f812e5eddb9980557fa83678b3a) --- init/util_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init/util_test.cpp b/init/util_test.cpp index 96a5b5511..08343dcb5 100644 --- a/init/util_test.cpp +++ b/init/util_test.cpp @@ -61,8 +61,9 @@ TEST(util, ReadFileWorldWiteable) { TEST(util, ReadFileSymbolicLink) { errno = 0; - // lrw------- 1 root root 23 2008-12-31 19:00 default.prop -> system/etc/prop.default - auto file_contents = ReadFile("/default.prop"); + // lrwxrwxrwx 1 root shell 6 2020-06-26 09:55 /system/bin/ps -> toybox + auto file_contents = ReadFile("/system/bin/ps"); + EXPECT_EQ(ELOOP, errno); ASSERT_FALSE(file_contents.ok()); EXPECT_EQ("open() failed: Too many symbolic links encountered",