summaryrefslogtreecommitdiff
path: root/usr.sbin/acpidump
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2021-07-12 15:09:23 +0000
committerBob Beck <beck@cvs.openbsd.org>2021-07-12 15:09:23 +0000
commit73e82762d46ada77045a4c76185bdd75e2e712c3 (patch)
tree1e6fb3124598f66f9f86720c24b0174176b345c2 /usr.sbin/acpidump
parente8f12d212e4dfa88699628d0df2a4e442a348350 (diff)
Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by deraadt@ after some tech discussion. Work done and verified by Ashton Fagg <ashton@fagg.id.au> ok deraadt@ semarie@ claudio@
Diffstat (limited to 'usr.sbin/acpidump')
-rw-r--r--usr.sbin/acpidump/acpidump.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/acpidump/acpidump.c b/usr.sbin/acpidump/acpidump.c
index ff10d766445..e08a6edada9 100644
--- a/usr.sbin/acpidump/acpidump.c
+++ b/usr.sbin/acpidump/acpidump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidump.c,v 1.23 2019/05/11 19:17:56 lteo Exp $ */
+/* $OpenBSD: acpidump.c,v 1.24 2021/07/12 15:09:20 beck Exp $ */
/*
* Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
* All rights reserved.
@@ -606,25 +606,25 @@ asl_dump_from_devmem(void)
/* Can only unveil if being dumped to a dir */
if (aml_dumpdir) {
if (unveil(aml_dumpfile, "wc") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", aml_dumpfile);
} else if (aml_dumpfile[0] == '/') { /* admittedly pretty shitty */
if (unveil("/", "wc") == -1)
- err(1, "unveil");
+ err(1, "unveil /");
} else {
if (unveil(".", "wc") == -1)
- err(1, "unveil");
+ err(1, "unveil .");
}
if (unveil(_PATH_MEM, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_MEM);
if (unveil(_PATH_KMEM, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_KMEM);
if (unveil(_PATH_KVMDB, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_KVMDB);
if (unveil(_PATH_KSYMS, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_KSYMS);
if (unveil(_PATH_UNIX, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_UNIX);
if (pledge("stdio rpath wpath cpath", NULL) == -1)
err(1, "pledge");