mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-12-09 22:05:47 -05:00
19.1: Add toggle for /etc/hosts
Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
parent
879256139f
commit
4f64f7538c
10 changed files with 254 additions and 20 deletions
|
|
@ -0,0 +1,33 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tad <tad@spotco.us>
|
||||
Date: Wed, 20 Apr 2022 00:40:53 -0400
|
||||
Subject: [PATCH] Add a toggle to disable /etc/hosts lookup
|
||||
|
||||
Signed-off-by: Tad <tad@spotco.us>
|
||||
Change-Id: Iea165003474e1107dc77980985bf9928c369dbb5
|
||||
---
|
||||
getaddrinfo.cpp | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/getaddrinfo.cpp b/getaddrinfo.cpp
|
||||
index 071f6ac..955b5c2 100644
|
||||
--- a/getaddrinfo.cpp
|
||||
+++ b/getaddrinfo.cpp
|
||||
@@ -57,6 +57,7 @@
|
||||
#include <future>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
+#include <android-base/properties.h>
|
||||
|
||||
#include "Experiments.h"
|
||||
#include "netd_resolv/resolv.h"
|
||||
@@ -1556,6 +1557,9 @@ static struct addrinfo* getCustomHosts(const size_t netid, const char* _Nonnull
|
||||
|
||||
static bool files_getaddrinfo(const size_t netid, const char* name, const addrinfo* pai,
|
||||
addrinfo** res) {
|
||||
+ if (android::base::GetIntProperty("persist.security.hosts_disable", 0) != 0 && name != "localhost" && name != "ip6-localhost")
|
||||
+ return false;
|
||||
+
|
||||
struct addrinfo sentinel = {};
|
||||
struct addrinfo *p, *cur;
|
||||
FILE* hostf = nullptr;
|
||||
Loading…
Add table
Add a link
Reference in a new issue