Revert "Use proprety_socket_for_system if permissions allow"
This reverts commit 24839a681e0f8d19ef5685cdf62631d8df2155f5.
These fixes for b/262208935 introduced a race condition. We believe the
race is fixed by ag/23879563, but at this point in the release feel that
reverting the fixes and refixing in main is the better solution
Test: Builds, boots
Bug: 283202477
Bug: 288991737
Ignore-AOSP-First: Reverting CL only in internal
Change-Id: If0736e504928641c85934eae4d298f14e711116c
diff --git a/libc/bionic/system_property_set.cpp b/libc/bionic/system_property_set.cpp
index bde0c10..212aafc 100644
--- a/libc/bionic/system_property_set.cpp
+++ b/libc/bionic/system_property_set.cpp
@@ -49,8 +49,6 @@
#include "private/ScopedFd.h"
static const char property_service_socket[] = "/dev/socket/" PROP_SERVICE_NAME;
-static const char property_service_for_system_socket[] =
- "/dev/socket/" PROP_SERVICE_FOR_SYSTEM_NAME;
static const char* kServiceVersionPropertyName = "ro.property_service.version";
class PropertyServiceConnection {
@@ -62,13 +60,10 @@
return;
}
- const char* socket = access(property_service_for_system_socket, W_OK) == 0
- ? property_service_for_system_socket
- : property_service_socket;
- const size_t namelen = strlen(socket);
+ const size_t namelen = strlen(property_service_socket);
sockaddr_un addr;
memset(&addr, 0, sizeof(addr));
- strlcpy(addr.sun_path, socket, sizeof(addr.sun_path));
+ strlcpy(addr.sun_path, property_service_socket, sizeof(addr.sun_path));
addr.sun_family = AF_LOCAL;
socklen_t alen = namelen + offsetof(sockaddr_un, sun_path) + 1;