diff options
| author | Elliott Hughes <enh@google.com> | 2018-10-25 13:24:08 -0700 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2018-10-25 13:24:08 -0700 |
| commit | 4ee0f93ef2f1acf65302274c6846eea5351a16b5 (patch) | |
| tree | 7300bd164fc573d39c18c359f6cfe640d7d11c57 /libcutils/sockets_unix.cpp | |
| parent | 993e11132320371d923b79b416f460228d725242 (diff) | |
libcutils: lose socket_peer_is_trusted to ART, the only user.
Bug: N/A
Test: builds
Change-Id: I599270729c2037b2c06d7906a5e5f7362fbbaf08
Diffstat (limited to 'libcutils/sockets_unix.cpp')
| -rw-r--r-- | libcutils/sockets_unix.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/libcutils/sockets_unix.cpp b/libcutils/sockets_unix.cpp index 0cb8a4dc52..22488178f1 100644 --- a/libcutils/sockets_unix.cpp +++ b/libcutils/sockets_unix.cpp @@ -32,34 +32,6 @@ #include "android_get_control_env.h" -#if defined(__ANDROID__) -/* For the socket trust (credentials) check */ -#include <private/android_filesystem_config.h> -#define __android_unused -#else -#define __android_unused __attribute__((__unused__)) -#endif - -bool socket_peer_is_trusted(int fd __android_unused) { -#if defined(__ANDROID__) - ucred cr; - socklen_t len = sizeof(cr); - int n = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len); - - if (n != 0) { - ALOGE("could not get socket credentials: %s\n", strerror(errno)); - return false; - } - - if ((cr.uid != AID_ROOT) && (cr.uid != AID_SHELL)) { - ALOGE("untrusted userid on other end of socket: userid %d\n", cr.uid); - return false; - } -#endif - - return true; -} - int socket_close(int sock) { return close(sock); } |
