summaryrefslogtreecommitdiff
path: root/sbin/shutdown/shutdown.c
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 /sbin/shutdown/shutdown.c
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 'sbin/shutdown/shutdown.c')
-rw-r--r--sbin/shutdown/shutdown.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index d28eb676172..38b10bb56df 100644
--- a/sbin/shutdown/shutdown.c
+++ b/sbin/shutdown/shutdown.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shutdown.c,v 1.52 2018/08/03 17:09:22 deraadt Exp $ */
+/* $OpenBSD: shutdown.c,v 1.53 2021/07/12 15:09:19 beck Exp $ */
/* $NetBSD: shutdown.c,v 1.9 1995/03/18 15:01:09 cgd Exp $ */
/*
@@ -166,24 +166,24 @@ main(int argc, char *argv[])
}
if (unveil(_PATH_CONSOLE, "rw") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_CONSOLE);
if (unveil(_PATH_RC, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_RC);
if (unveil(_PATH_WALL, "x") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_WALL);
if (unveil(_PATH_FASTBOOT, "wc") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_FASTBOOT);
if (unveil(_PATH_NOLOGIN, "wc") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_NOLOGIN);
if (dohalt || dopower) {
if (unveil(_PATH_HALT, "x") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_HALT);
} else if (doreboot) {
if (unveil(_PATH_REBOOT, "x") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_REBOOT);
} else {
if (unveil(_PATH_BSHELL, "x") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", _PATH_BSHELL);
}
if (pledge("stdio rpath wpath cpath getpw tty id proc exec", NULL) == -1)
err(1, "pledge");