Merge "logd: add "+passcred" for logdw socket" am: cc22a8e5a2

am: 518f054bfd

Change-Id: I720ff1aa0bc6726220d2f6db9bfa287e3be18c0e
This commit is contained in:
Mark Salyzyn 2017-05-09 01:09:06 +00:00 committed by android-build-merger
commit ff04ade5e4
2 changed files with 6 additions and 6 deletions

View File

@ -119,14 +119,14 @@ int LogListener::getLogSocket() {
static const char socketName[] = "logdw";
int sock = android_get_control_socket(socketName);
if (sock < 0) {
if (sock < 0) { // logd started up in init.sh
sock = socket_local_server(
socketName, ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_DGRAM);
}
int on = 1;
if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
return -1;
int on = 1;
if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on))) {
return -1;
}
}
return sock;
}

View File

@ -1,7 +1,7 @@
service logd /system/bin/logd
socket logd stream 0666 logd logd
socket logdr seqpacket 0666 logd logd
socket logdw dgram 0222 logd logd
socket logdw dgram+passcred 0222 logd logd
file /proc/kmsg r
file /dev/kmsg w
user logd