diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2021-07-12 15:09:23 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2021-07-12 15:09:23 +0000 |
commit | 73e82762d46ada77045a4c76185bdd75e2e712c3 (patch) | |
tree | 1e6fb3124598f66f9f86720c24b0174176b345c2 /usr.bin/chpass | |
parent | e8f12d212e4dfa88699628d0df2a4e442a348350 (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/chpass')
-rw-r--r-- | usr.bin/chpass/chpass.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index f20b7f18b9b..72c622eb40c 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chpass.c,v 1.46 2019/09/14 17:47:00 semarie Exp $ */ +/* $OpenBSD: chpass.c,v 1.47 2021/07/12 15:09:19 beck Exp $ */ /* $NetBSD: chpass.c,v 1.8 1996/05/15 21:50:43 jtc Exp $ */ /*- @@ -137,11 +137,11 @@ main(int argc, char *argv[]) display(tempname, dfd, pw); if (unveil(_PATH_BSHELL, "x") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_BSHELL); if (unveil(_PATH_SHELLS, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_SHELLS); if (unveil(tempname, "rc") == -1) - err(1, "unveil"); + err(1, "unveil %s", tempname); if (pledge("stdio rpath wpath cpath id proc exec unveil", NULL) == -1) err(1, "pledge"); @@ -165,7 +165,7 @@ main(int argc, char *argv[]) if (op == NEWSH) { if (unveil(_PATH_SHELLS, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_SHELLS); if (pledge("stdio rpath wpath cpath id proc exec unveil", NULL) == -1) err(1, "pledge"); @@ -184,11 +184,11 @@ main(int argc, char *argv[]) sigprocmask(SIG_BLOCK, &fullset, NULL); if (unveil(_PATH_MASTERPASSWD_LOCK, "rwc") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_MASTERPASSWD_LOCK); if (unveil(_PATH_MASTERPASSWD, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_MASTERPASSWD); if (unveil(_PATH_PWD_MKDB, "x") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_PWD_MKDB); if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) err(1, "pledge"); |