Revert "Use proprety_socket_for_system if permissions allow" am: 78973da8ef

Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/24028889

Change-Id: I4bd998f8a7ee33c0d6d7bc55b75866bc853e5ab6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Paul Lawrence 2023-07-17 16:47:24 +00:00 committed by Automerger Merge Worker
commit 1d795fe6f7
2 changed files with 2 additions and 8 deletions

View file

@ -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;

View file

@ -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