From c6a3fbae7e17869b48363dce80e26085d46c9104 Mon Sep 17 00:00:00 2001 From: kn Date: Tue, 2 Mar 2021 09:17:10 +0000 Subject: [PATCH] Do not unveil unused unwind socket under SMALL Remove unused STARTUP_WAIT_TIMO (since import), add missing space to error message. --- sbin/resolvd/resolvd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sbin/resolvd/resolvd.c b/sbin/resolvd/resolvd.c index 0f73b8b7b04..96a5cd9fa6a 100644 --- a/sbin/resolvd/resolvd.c +++ b/sbin/resolvd/resolvd.c @@ -40,11 +40,12 @@ #define ROUTE_SOCKET_BUF_SIZE 16384 #define ASR_MAXNS 10 +#ifndef SMALL #define _PATH_UNWIND_SOCKET "/dev/unwind.sock" +#endif #define _PATH_RESCONF "/etc/resolv.conf" #define _PATH_RESCONF_NEW "/etc/resolv.conf.new" #define _PATH_LOCKFILE "/var/run/resolvd.lock" -#define STARTUP_WAIT_TIMO 1 #ifndef nitems #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) @@ -215,8 +216,10 @@ main(int argc, char *argv[]) if (unveil("/etc", "rwc") == -1) lerr(1, "unveil /etc"); +#ifndef SMALL if (unveil(_PATH_UNWIND_SOCKET, "r") == -1) - lerr(1, "unveil" _PATH_UNWIND_SOCKET); + lerr(1, "unveil " _PATH_UNWIND_SOCKET); +#endif if (pledge("stdio unix rpath wpath cpath", NULL) == -1) lerr(1, "pledge"); -- 2.20.1