summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2017-05-05 17:32:10 -0500
committerMark Salyzyn2017-05-08 18:19:48 -0500
commit54d8ff1121440d0ef4565ce0ab3751f82fdb393c (patch)
treef4d3401d31d70cc5ed4794557de654d3092520f8 /logd/LogListener.cpp
parent9811cd33ac6ae18e8ac41f5ca312772e0bbdeafd (diff)
downloadplatform-system-core-54d8ff1121440d0ef4565ce0ab3751f82fdb393c.tar.gz
platform-system-core-54d8ff1121440d0ef4565ce0ab3751f82fdb393c.tar.xz
platform-system-core-54d8ff1121440d0ef4565ce0ab3751f82fdb393c.zip
logd: add "+passcred" for logdw socket
Tell init to set SO_PASSCRED on the socket before bind() and handoff. Test: gtest logd-unit-test --gtest_filter=logd.statistics right after boot Bug: 37985222 Change-Id: I318969ee3241834e5326233aabd97e52ef505969
Diffstat (limited to 'logd/LogListener.cpp')
-rw-r--r--logd/LogListener.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index 709646e37..3c0d08dc6 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -119,14 +119,14 @@ int LogListener::getLogSocket() {
119 static const char socketName[] = "logdw"; 119 static const char socketName[] = "logdw";
120 int sock = android_get_control_socket(socketName); 120 int sock = android_get_control_socket(socketName);
121 121
122 if (sock < 0) { 122 if (sock < 0) { // logd started up in init.sh
123 sock = socket_local_server( 123 sock = socket_local_server(
124 socketName, ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_DGRAM); 124 socketName, ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_DGRAM);
125 }
126 125
127 int on = 1; 126 int on = 1;
128 if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) { 127 if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on))) {
129 return -1; 128 return -1;
129 }
130 } 130 }
131 return sock; 131 return sock;
132} 132}