diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-03-17 13:15:14 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-03-17 13:15:15 +0000 |
commit | de148c40d2b7d10d0f99726a62a7761ef2bf927d (patch) | |
tree | 191f0973c98b20754bf97b1afd3a8c5b84930af6 | |
parent | 66c4c5b6b715f325a3f262f96148cbe2594aaed1 (diff) | |
parent | b8e401eea37de5318c9b7e51489da5b815f8abb2 (diff) | |
download | mtpd-de148c40d2b7d10d0f99726a62a7761ef2bf927d.tar.gz |
Merge "Protect mtpd socket from VPN"
-rw-r--r-- | Android.bp | 1 | ||||
-rw-r--r-- | mtpd.c | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -23,6 +23,7 @@ cc_binary { "libcrypto", "libcutils", "liblog", + "libnetd_client", ], cflags: ["-DANDROID_CHANGES"], init_rc: ["mtpd.rc"], @@ -35,6 +35,7 @@ #endif #include "mtpd.h" +#include "NetdClient.h" int the_socket = -1; @@ -295,6 +296,10 @@ void create_socket(int family, int type, char *server, char *port) exit(NETWORK_ERROR); } +#ifdef ANDROID_CHANGES + protectFromVpn(the_socket); +#endif + fcntl(the_socket, F_SETFD, FD_CLOEXEC); log_print(INFO, "Connection established (socket = %d)", the_socket); } |