summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2022-10-04 07:01:39 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2022-10-04 07:01:39 +0000
commit3a74722b6fa89f258baccbdfbe930dca57ef90ce (patch)
treea43229cdf9c3fcda47189667bc1a68081f604c8f /usr.sbin
parent39096875b4fe0b899680f3ac8d37d1db669a66a5 (diff)
Unveil /tftpboot only if needed
Unless -t is used, this directory is not accessed in any way. OK millert
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rarpd/rarpd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index fbb0b953eb9..881039427ad 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rarpd.c,v 1.79 2021/11/15 15:14:24 millert Exp $ */
+/* $OpenBSD: rarpd.c,v 1.80 2022/10/04 07:01:38 kn Exp $ */
/* $NetBSD: rarpd.c,v 1.25 1998/04/23 02:48:33 mrg Exp $ */
/*
@@ -339,8 +339,9 @@ rarp_loop(void)
arptab_init();
- if (unveil(TFTP_DIR, "r") == -1)
- error("unveil %s", TFTP_DIR);
+ if (tflag)
+ if (unveil(TFTP_DIR, "r") == -1)
+ error("unveil %s", TFTP_DIR);
if (unveil("/etc/ethers", "r") == -1)
error("unveil /etc/ethers");
if (pledge("stdio rpath dns", NULL) == -1)