From e18d014a7ec1b1e0ac6f08e584776d002f39ccf5 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 15 Aug 2018 14:43:30 +0000 Subject: [PATCH] Restore ability to use hostnames to configure ip addresses. Unveil /etc/{resolv.conf,hosts,services} which keeps it in sync with the kernel bypass for pledge("dns"). OK deraadt pointed out by & OK stsp --- sbin/ifconfig/ifconfig.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index f36de2829e2..d14bb54e051 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.375 2018/08/12 23:50:31 ccardenas Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.376 2018/08/15 14:43:30 florian Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -749,7 +749,11 @@ main(int argc, char *argv[]) } if (!found_rulefile) { - if (unveil("/", "") == -1) + if (unveil("/etc/resolv.conf", "r") == -1) + err(1, "unveil"); + if (unveil("/etc/hosts", "r") == -1) + err(1, "unveil"); + if (unveil("/etc/services", "r") == -1) err(1, "unveil"); if (unveil(NULL, NULL) == -1) err(1, "unveil"); -- 2.20.1