aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2023-07-11 09:06:26 -0700
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-18 04:29:46 +0000
commit1133a8d39fa6ec881d5346894dc2c7e0ff3cd198 (patch)
tree7f0387af5681fb69ea2ba014bc07e3ec08179070
parent6b424c3bf62d84c806cb645ce31155a2d2d9fbbc (diff)
downloadbionic-1133a8d39fa6ec881d5346894dc2c7e0ff3cd198.tar.gz
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 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:78973da8efdb5b82f9833cf9a25ed89a752e1033) Merged-In: If0736e504928641c85934eae4d298f14e711116c Change-Id: If0736e504928641c85934eae4d298f14e711116c
-rw-r--r--libc/bionic/system_property_set.cpp9
-rw-r--r--libc/include/sys/_system_properties.h1
2 files changed, 2 insertions, 8 deletions
diff --git a/libc/bionic/system_property_set.cpp b/libc/bionic/system_property_set.cpp
index bde0c1002..212aafcc1 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 @@ class PropertyServiceConnection {
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;
diff --git a/libc/include/sys/_system_properties.h b/libc/include/sys/_system_properties.h
index c7a30ebbd..744a45b71 100644
--- a/libc/include/sys/_system_properties.h
+++ b/libc/include/sys/_system_properties.h
@@ -41,7 +41,6 @@
__BEGIN_DECLS
#define PROP_SERVICE_NAME "property_service"
-#define PROP_SERVICE_FOR_SYSTEM_NAME "property_service_for_system"
#define PROP_FILENAME "/dev/__properties__"
#define PROP_MSG_SETPROP 1