summaryrefslogtreecommitdiff
path: root/usr.bin/doas
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.bin/doas
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.bin/doas')
-rw-r--r--usr.bin/doas/doas.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c
index be05be3a968..5fccac85724 100644
--- a/usr.bin/doas/doas.c
+++ b/usr.bin/doas/doas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: doas.c,v 1.89 2021/01/27 17:02:50 millert Exp $ */
+/* $OpenBSD: doas.c,v 1.90 2021/07/12 15:09:19 beck Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -416,9 +416,10 @@ main(int argc, char **argv)
if (formerpath == NULL)
formerpath = "";
- if (unveil(_PATH_LOGIN_CONF, "r") == -1 ||
- unveil(_PATH_LOGIN_CONF ".db", "r") == -1)
- err(1, "unveil");
+ if (unveil(_PATH_LOGIN_CONF, "r") == -1)
+ err(1, "unveil %s", _PATH_LOGIN_CONF);
+ if (unveil(_PATH_LOGIN_CONF ".db", "r") == -1)
+ err(1, "unveil %s.db", _PATH_LOGIN_CONF);
if (rule->cmd) {
if (setenv("PATH", safepath, 1) == -1)
err(1, "failed to set PATH '%s'", safepath);