Skip to content
Snippets Groups Projects
Verified Commit 6082e053 authored by Michal Hrusecky's avatar Michal Hrusecky :mouse: Committed by Josef Schlehofer
Browse files

knot-resolver: Prefer files in /tmp/resolv.conf.d

File resolv.conf.auto is now stored mainly in the directory
/tmp/resolv.conf.d as well as resolv.conf files generated by OpenVPN
client, so let's prefer this directory for reading nameservers. It is
more secure.
parent 1313b15c
Branches
Tags
2 merge requests!982Turris OS 6.0 (HBK) (turrispackages),!941Prefer files in /tmp/resolv.conf.d
......@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=knot-resolver
PKG_VERSION:=5.5.1
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-resolver
......
......@@ -165,12 +165,12 @@ load_uci_config_common() {
# Test for resolv.conf.auto new location
# https://github.com/openwrt/openwrt/commit/cd48d8d3420dd4df03daaa548227ceb487ba7104
resolv_conf_path="$(ls -1 /etc/resolv.conf.vpn.* 2>/dev/null | head -n1)"
if [ \! -f "$resolv_conv_path" ]; then
if [ -f "/tmp/resolv.conf.auto" ]; then
resolv_conf_path="/tmp/resolv.conf.auto"
elif [ -f "/tmp/resolv.conf.d/resolv.conf.auto" ]; then
resolv_conf_path="$(ls -1 /tmp/resolv.conf.d/resolv.conf.vpn.* 2>/dev/null | head -n1)"
if [ \! -f "$resolv_conf_path" ]; then
if [ -f "/tmp/resolv.conf.d/resolv.conf.auto" ]; then
resolv_conf_path="/tmp/resolv.conf.d/resolv.conf.auto"
elif [ -f "/tmp/resolv.conf.auto" ]; then
resolv_conf_path="/tmp/resolv.conf.auto"
else
resolv_conf_path=""
echo "Error! File resolv.conf.auto is missing"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment