Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)
Change-Id: I09a8a6d7c654869a40339adce181e6b981f10369
diff --git a/NetlinkManager.cpp b/NetlinkManager.cpp
index 36db0ff..9fb86ae 100644
--- a/NetlinkManager.cpp
+++ b/NetlinkManager.cpp
@@ -50,6 +50,7 @@
int NetlinkManager::start() {
struct sockaddr_nl nladdr;
int sz = 64 * 1024;
+ int on = 1;
memset(&nladdr, 0, sizeof(nladdr));
nladdr.nl_family = AF_NETLINK;
@@ -62,7 +63,8 @@
return -1;
}
- if (setsockopt(mSock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0) {
+ if (setsockopt(mSock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0 ||
+ setsockopt(mSock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
SLOGE("Unable to set uevent socket options: %s", strerror(errno));
return -1;
}