diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/audioctl/audioctl.c | 6 | ||||
-rw-r--r-- | usr.bin/biff/biff.c | 4 | ||||
-rw-r--r-- | usr.bin/chpass/chpass.c | 16 | ||||
-rw-r--r-- | usr.bin/ctfconv/ctfconv.c | 6 | ||||
-rw-r--r-- | usr.bin/doas/doas.c | 9 | ||||
-rw-r--r-- | usr.bin/encrypt/encrypt.c | 9 | ||||
-rw-r--r-- | usr.bin/from/from.c | 4 | ||||
-rw-r--r-- | usr.bin/getconf/getconf.c | 4 | ||||
-rw-r--r-- | usr.bin/getent/getent.c | 4 | ||||
-rw-r--r-- | usr.bin/htpasswd/htpasswd.c | 6 | ||||
-rw-r--r-- | usr.bin/kdump/kdump.c | 6 | ||||
-rw-r--r-- | usr.bin/last/last.c | 4 | ||||
-rw-r--r-- | usr.bin/look/look.c | 4 | ||||
-rw-r--r-- | usr.bin/mesg/mesg.c | 4 | ||||
-rw-r--r-- | usr.bin/mixerctl/mixerctl.c | 4 | ||||
-rw-r--r-- | usr.bin/nc/netcat.c | 18 | ||||
-rw-r--r-- | usr.bin/passwd/local_passwd.c | 16 | ||||
-rw-r--r-- | usr.bin/sdiff/sdiff.c | 14 | ||||
-rw-r--r-- | usr.bin/sndiod/sndiod.c | 4 | ||||
-rw-r--r-- | usr.bin/su/su.c | 20 | ||||
-rw-r--r-- | usr.bin/systat/main.c | 4 | ||||
-rw-r--r-- | usr.bin/tcpbench/tcpbench.c | 10 | ||||
-rw-r--r-- | usr.bin/tty/tty.c | 4 | ||||
-rw-r--r-- | usr.bin/users/users.c | 4 | ||||
-rw-r--r-- | usr.bin/vmstat/vmstat.c | 4 | ||||
-rw-r--r-- | usr.bin/wall/wall.c | 8 | ||||
-rw-r--r-- | usr.bin/who/who.c | 12 |
27 files changed, 105 insertions, 103 deletions
diff --git a/usr.bin/audioctl/audioctl.c b/usr.bin/audioctl/audioctl.c index ec2c1927695..abe3f3f1fb6 100644 --- a/usr.bin/audioctl/audioctl.c +++ b/usr.bin/audioctl/audioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audioctl.c,v 1.42 2020/02/02 05:25:41 ratchov Exp $ */ +/* $OpenBSD: audioctl.c,v 1.43 2021/07/12 15:09:19 beck Exp $ */ /* * Copyright (c) 2016 Alexandre Ratchov <alex@caoua.org> * @@ -285,7 +285,7 @@ main(int argc, char **argv) argv += optind; if (unveil(path, "w") == -1) - err(1, "unveil"); + err(1, "unveil %s", path); if (unveil(NULL, NULL) == -1) err(1, "unveil"); @@ -296,5 +296,5 @@ main(int argc, char **argv) audio_main(argc, argv); close(fd); - return 0; + return 0; } diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c index f8c102f5dfc..231b3601ec5 100644 --- a/usr.bin/biff/biff.c +++ b/usr.bin/biff/biff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biff.c,v 1.17 2019/06/28 13:35:00 deraadt Exp $ */ +/* $OpenBSD: biff.c,v 1.18 2021/07/12 15:09:19 beck Exp $ */ /* $NetBSD: biff.c,v 1.3 1995/03/26 02:34:22 glass Exp $ */ /* @@ -62,7 +62,7 @@ main(int argc, char *argv[]) err(2, "tty"); if (unveil(name, "rw") == -1) - err(2, "unveil"); + err(2, "unveil %s", name); if (pledge("stdio rpath fattr", NULL) == -1) err(2, "pledge"); 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"); diff --git a/usr.bin/ctfconv/ctfconv.c b/usr.bin/ctfconv/ctfconv.c index f47af91541d..6fbaca0157c 100644 --- a/usr.bin/ctfconv/ctfconv.c +++ b/usr.bin/ctfconv/ctfconv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ctfconv.c,v 1.18 2019/11/07 13:39:08 mpi Exp $ */ +/* $OpenBSD: ctfconv.c,v 1.19 2021/07/12 15:09:19 beck Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -128,11 +128,11 @@ main(int argc, char *argv[]) filename = *argv; if (unveil(filename, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", filename); if (outfile != NULL) { if (unveil(outfile, "wc") == -1) - err(1, "unveil"); + err(1, "unveil %s", outfile); } if (pledge("stdio rpath wpath cpath", NULL) == -1) 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); diff --git a/usr.bin/encrypt/encrypt.c b/usr.bin/encrypt/encrypt.c index 01e96edd9f8..04ea7c5b98f 100644 --- a/usr.bin/encrypt/encrypt.c +++ b/usr.bin/encrypt/encrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: encrypt.c,v 1.50 2019/09/14 17:47:00 semarie Exp $ */ +/* $OpenBSD: encrypt.c,v 1.51 2021/07/12 15:09:19 beck Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. @@ -95,9 +95,10 @@ main(int argc, char **argv) char *extra = NULL; /* Store login class or number of rounds */ const char *errstr; - 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 (pledge("stdio rpath tty", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c index 59b743e7247..b3e96a24887 100644 --- a/usr.bin/from/from.c +++ b/usr.bin/from/from.c @@ -1,4 +1,4 @@ -/* $OpenBSD: from.c,v 1.27 2020/05/29 07:16:50 mestre Exp $ */ +/* $OpenBSD: from.c,v 1.28 2021/07/12 15:09:19 beck Exp $ */ /* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */ /* @@ -80,7 +80,7 @@ main(int argc, char *argv[]) file = mail_spool(file, *argv); if (unveil(file, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", file); if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c index 3cf332f1181..f3240af8bd4 100644 --- a/usr.bin/getconf/getconf.c +++ b/usr.bin/getconf/getconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getconf.c,v 1.20 2018/10/26 17:11:32 mestre Exp $ */ +/* $OpenBSD: getconf.c,v 1.21 2021/07/12 15:09:19 beck Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -514,7 +514,7 @@ main(int argc, char *argv[]) case PATHCONF: if (unveil(argv[1], "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", argv[1]); if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); errno = 0; diff --git a/usr.bin/getent/getent.c b/usr.bin/getent/getent.c index 3555f3420f0..278d3b03985 100644 --- a/usr.bin/getent/getent.c +++ b/usr.bin/getent/getent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getent.c,v 1.21 2018/11/02 10:21:29 kn Exp $ */ +/* $OpenBSD: getent.c,v 1.22 2021/07/12 15:09:19 beck Exp $ */ /* $NetBSD: getent.c,v 1.7 2005/08/24 14:31:02 ginsbach Exp $ */ /*- @@ -102,7 +102,7 @@ main(int argc, char *argv[]) if (strcmp(curdb->name, argv[1]) == 0) { if (curdb->unveil != NULL) { if (unveil(curdb->unveil, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", curdb->unveil); } if (pledge(curdb->pledge, NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/htpasswd/htpasswd.c b/usr.bin/htpasswd/htpasswd.c index 85a7f5ccece..03a9e762c12 100644 --- a/usr.bin/htpasswd/htpasswd.c +++ b/usr.bin/htpasswd/htpasswd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: htpasswd.c,v 1.17 2018/10/31 07:39:10 mestre Exp $ */ +/* $OpenBSD: htpasswd.c,v 1.18 2021/07/12 15:09:19 beck Exp $ */ /* * Copyright (c) 2014 Florian Obser <florian@openbsd.org> * @@ -74,9 +74,9 @@ main(int argc, char** argv) if ((batch && argc == 1) || (!batch && argc == 2)) { if (unveil(argv[0], "rwc") == -1) - err(1, "unveil"); + err(1, "unveil %s", argv[0]); if (unveil("/tmp", "rwc") == -1) - err(1, "unveil"); + err(1, "unveil /tmp"); } if (pledge("stdio rpath wpath cpath flock tmppath tty", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index fb71d3c7520..52356862c40 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kdump.c,v 1.143 2020/04/05 08:32:14 mpi Exp $ */ +/* $OpenBSD: kdump.c,v 1.144 2021/07/12 15:09:19 beck Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -223,9 +223,9 @@ main(int argc, char *argv[]) if (strcmp(tracefile, "-") != 0) if (unveil(tracefile, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", tracefile); if (unveil(_PATH_PROTOCOLS, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_PROTOCOLS); if (pledge("stdio rpath getpw", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 98688a7bbcf..76d576106fe 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -1,4 +1,4 @@ -/* $OpenBSD: last.c,v 1.52 2019/06/28 13:35:01 deraadt Exp $ */ +/* $OpenBSD: last.c,v 1.53 2021/07/12 15:09:19 beck Exp $ */ /* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */ /* @@ -153,7 +153,7 @@ main(int argc, char *argv[]) exit(0); if (unveil(file, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", file); if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/look/look.c b/usr.bin/look/look.c index fa0b7353bc2..0ccfd1703be 100644 --- a/usr.bin/look/look.c +++ b/usr.bin/look/look.c @@ -1,4 +1,4 @@ -/* $OpenBSD: look.c,v 1.23 2019/06/28 13:35:01 deraadt Exp $ */ +/* $OpenBSD: look.c,v 1.24 2021/07/12 15:09:20 beck Exp $ */ /* $NetBSD: look.c,v 1.7 1995/08/31 22:41:02 jtc Exp $ */ /*- @@ -111,7 +111,7 @@ main(int argc, char *argv[]) } if (unveil(file, "r") == -1) - err(2, "unveil"); + err(2, "unveil %s", file); if (pledge("stdio rpath", NULL) == -1) err(2, "pledge"); diff --git a/usr.bin/mesg/mesg.c b/usr.bin/mesg/mesg.c index d682e9e9bcd..0423eff7029 100644 --- a/usr.bin/mesg/mesg.c +++ b/usr.bin/mesg/mesg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mesg.c,v 1.16 2019/06/28 13:35:02 deraadt Exp $ */ +/* $OpenBSD: mesg.c,v 1.17 2021/07/12 15:09:20 beck Exp $ */ /* $NetBSD: mesg.c,v 1.4 1994/12/23 07:16:32 jtc Exp $ */ /* @@ -65,7 +65,7 @@ main(int argc, char *argv[]) err(2, "ttyname"); if (unveil(tty, "rw") == -1) - err(2, "unveil"); + err(2, "unveil %s", tty); if (pledge("stdio rpath fattr", NULL) == -1) err(2, "pledge"); diff --git a/usr.bin/mixerctl/mixerctl.c b/usr.bin/mixerctl/mixerctl.c index e454d9d64bc..c572ab36c08 100644 --- a/usr.bin/mixerctl/mixerctl.c +++ b/usr.bin/mixerctl/mixerctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mixerctl.c,v 1.33 2020/04/04 08:43:08 ratchov Exp $ */ +/* $OpenBSD: mixerctl.c,v 1.34 2021/07/12 15:09:20 beck Exp $ */ /* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */ /* @@ -285,7 +285,7 @@ main(int argc, char **argv) aflag = 1; if (unveil(file, "w") == -1) - err(1, "unveil"); + err(1, "unveil %s", file); if (unveil(NULL, NULL) == -1) err(1, "unveil"); diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c index 503095584ad..811551f57da 100644 --- a/usr.bin/nc/netcat.c +++ b/usr.bin/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.217 2020/02/12 14:46:36 schwarze Exp $ */ +/* $OpenBSD: netcat.c,v 1.218 2021/07/12 15:09:20 beck Exp $ */ /* * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -364,13 +364,13 @@ main(int argc, char *argv[]) if (usetls) { if (Cflag && unveil(Cflag, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", Cflag); if (unveil(Rflag, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", Rflag); if (Kflag && unveil(Kflag, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", Kflag); if (oflag && unveil(oflag, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", oflag); } else if (family == AF_UNIX && uflag && lflag && !kflag) { /* * After recvfrom(2) from client, the server connects @@ -380,20 +380,20 @@ main(int argc, char *argv[]) } else { if (family == AF_UNIX) { if (unveil(host, "rwc") == -1) - err(1, "unveil"); + err(1, "unveil %s", host); if (uflag && !kflag) { if (sflag) { if (unveil(sflag, "rwc") == -1) - err(1, "unveil"); + err(1, "unveil %s", sflag); } else { if (unveil("/tmp", "rwc") == -1) - err(1, "unveil"); + err(1, "unveil /tmp"); } } } else { /* no filesystem visibility */ if (unveil("/", "") == -1) - err(1, "unveil"); + err(1, "unveil /"); } } diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index 955eb9e3820..97720018337 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: local_passwd.c,v 1.58 2019/10/24 12:56:40 anton Exp $ */ +/* $OpenBSD: local_passwd.c,v 1.59 2021/07/12 15:09:20 beck Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -73,19 +73,19 @@ local_passwd(char *uname, int authenticated) } 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_LOGIN_CONF, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_LOGIN_CONF); if (unveil(_PATH_LOGIN_CONF ".db", "r") == -1) - err(1, "unveil"); + err(1, "unveil %s.db", _PATH_LOGIN_CONF); 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(_PATH_PWD_MKDB, "x") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_PWD_MKDB); if (pledge("stdio rpath wpath cpath getpw tty id proc exec", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index 90207e16950..7039391ee57 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdiff.c,v 1.37 2018/09/28 18:21:52 mestre Exp $ */ +/* $OpenBSD: sdiff.c,v 1.38 2021/07/12 15:09:20 beck Exp $ */ /* * Written by Raymond Lai <ray@cyth.net>. @@ -255,7 +255,7 @@ main(int argc, char **argv) if (outfile && (outfp = fopen(outfile, "w")) == NULL) err(2, "could not open: %s", optarg); - if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') + if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') tmpdir = _PATH_TMP; filename1 = argv[0]; @@ -263,15 +263,15 @@ main(int argc, char **argv) if (!Fflag) { if (unveil(filename1, "r") == -1) - err(2, "unveil"); + err(2, "unveil %s", filename1); if (unveil(filename2, "r") == -1) - err(2, "unveil"); + err(2, "unveil %s", filename2); if (unveil(tmpdir, "rwc") == -1) - err(2, "unveil"); + err(2, "unveil %s", tmpdir); if (unveil("/usr/bin/diff", "x") == -1) - err(2, "unveil"); + err(2, "unveil /usr/bin/diff"); if (unveil(_PATH_BSHELL, "x") == -1) - err(2, "unveil"); + err(2, "unveil %s", _PATH_BSHELL); } if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) err(2, "pledge"); diff --git a/usr.bin/sndiod/sndiod.c b/usr.bin/sndiod/sndiod.c index 9a7daeb9e63..ad6a2cce7c3 100644 --- a/usr.bin/sndiod/sndiod.c +++ b/usr.bin/sndiod/sndiod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sndiod.c,v 1.45 2021/03/08 09:42:50 ratchov Exp $ */ +/* $OpenBSD: sndiod.c,v 1.46 2021/07/12 15:09:20 beck Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -378,7 +378,7 @@ dounveil(char *name, char *prefix, char *path_prefix) errx(1, "%s: unsupported device or port format", name); snprintf(path, sizeof(path), "%s%s", path_prefix, name + prefix_len); if (unveil(path, "rw") == -1) - err(1, "unveil"); + err(1, "unveil %s", path); } static int diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 193fe832e16..f9fb2c0ac88 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -1,4 +1,4 @@ -/* $OpenBSD: su.c,v 1.83 2020/10/30 16:23:57 millert Exp $ */ +/* $OpenBSD: su.c,v 1.84 2021/07/12 15:09:20 beck Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -161,17 +161,17 @@ main(int argc, char **argv) } if (unveil(_PATH_LOGIN_CONF, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_LOGIN_CONF); if (unveil(_PATH_LOGIN_CONF ".db", "r") == -1) - err(1, "unveil"); + err(1, "unveil %s.db", _PATH_LOGIN_CONF); if (unveil(_PATH_AUTHPROGDIR, "x") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_AUTHPROGDIR); if (unveil(_PATH_SHELLS, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_SHELLS); if (unveil(_PATH_DEVDB, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_DEVDB); if (unveil(_PATH_NOLOGIN, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_NOLOGIN); for (;;) { char *pw_class = class; @@ -251,9 +251,9 @@ main(int argc, char **argv) } if (unveil(shell, "x") == -1) - err(1, "unveil"); + err(1, "unveil %s", shell); if (unveil(pwd->pw_dir, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", pwd->pw_dir); if ((p = strrchr(shell, '/'))) avshell = p+1; @@ -283,7 +283,7 @@ main(int argc, char **argv) auth_err(as, 1, "%s", pwd->pw_dir); } else { if (unveil("/", "r") == -1) - err(1, "unveil"); + err(1, "unveil /"); printf("No home directory %s!\n", pwd->pw_dir); printf("Logging in with home = \"/\".\n"); if (chdir("/") == -1) diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 48b42ea0031..7a4225cc490 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.75 2021/07/02 15:34:16 millert Exp $ */ +/* $OpenBSD: main.c,v 1.76 2021/07/12 15:09:20 beck Exp $ */ /* * Copyright (c) 2001, 2007 Can Erkin Acar * Copyright (c) 2001 Daniel Hartmeier @@ -579,7 +579,7 @@ main(int argc, char *argv[]) setup_term(maxlines); if (unveil("/", "r") == -1) - err(1, "unveil"); + err(1, "unveil /"); if (unveil(NULL, NULL) == -1) err(1, "unveil"); diff --git a/usr.bin/tcpbench/tcpbench.c b/usr.bin/tcpbench/tcpbench.c index c56752ce10e..5eadee0fe30 100644 --- a/usr.bin/tcpbench/tcpbench.c +++ b/usr.bin/tcpbench/tcpbench.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcpbench.c,v 1.64 2021/02/04 18:46:25 bluhm Exp $ */ +/* $OpenBSD: tcpbench.c,v 1.65 2021/07/12 15:09:20 beck Exp $ */ /* * Copyright (c) 2008 Damien Miller <djm@mindrot.org> @@ -1273,11 +1273,11 @@ main(int argc, char **argv) if (ptb->kvars) { 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_KSYMS, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_KSYMS); if ((ptb->kvmh = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, kerr)) == NULL) @@ -1294,7 +1294,7 @@ main(int argc, char **argv) if (ptb->Uflag) if (unveil(host, "rwc") == -1) - err(1, "unveil"); + err(1, "unveil %s", host); if (pledge("stdio id dns inet unix", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/tty/tty.c b/usr.bin/tty/tty.c index 0409f441aca..d1ba54b5fa8 100644 --- a/usr.bin/tty/tty.c +++ b/usr.bin/tty/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.11 2018/08/03 06:55:41 deraadt Exp $ */ +/* $OpenBSD: tty.c,v 1.12 2021/07/12 15:09:20 beck Exp $ */ /* $NetBSD: tty.c,v 1.4 1994/12/07 00:46:57 jtc Exp $ */ /* @@ -58,7 +58,7 @@ main(int argc, char *argv[]) } if (unveil(_PATH_DEVDB, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_DEVDB); if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/users/users.c b/usr.bin/users/users.c index 07d43771a3a..2d7dc326819 100644 --- a/usr.bin/users/users.c +++ b/usr.bin/users/users.c @@ -1,4 +1,4 @@ -/* $OpenBSD: users.c,v 1.14 2018/08/03 16:02:53 deraadt Exp $ */ +/* $OpenBSD: users.c,v 1.15 2021/07/12 15:09:20 beck Exp $ */ /* $NetBSD: users.c,v 1.5 1994/12/20 15:58:19 jtc Exp $ */ /* @@ -54,7 +54,7 @@ main(int argc, char *argv[]) int ch; if (unveil(_PATH_UTMP, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_UTMP); if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index da88fe0e095..4b7123a9445 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1,5 +1,5 @@ /* $NetBSD: vmstat.c,v 1.29.4.1 1996/06/05 00:21:05 cgd Exp $ */ -/* $OpenBSD: vmstat.c,v 1.150 2019/11/28 16:27:26 guenther Exp $ */ +/* $OpenBSD: vmstat.c,v 1.151 2021/07/12 15:09:20 beck Exp $ */ /* * Copyright (c) 1980, 1986, 1991, 1993 @@ -213,7 +213,7 @@ main(int argc, char *argv[]) } if (unveil("/", "") == -1) - err(1, "unveil"); + err(1, "unveil /"); if (unveil(NULL, NULL) == -1) err(1, "unveil"); diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c index 9626dc16287..30fcecea645 100644 --- a/usr.bin/wall/wall.c +++ b/usr.bin/wall/wall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wall.c,v 1.34 2019/01/28 20:17:51 deraadt Exp $ */ +/* $OpenBSD: wall.c,v 1.35 2021/07/12 15:09:20 beck Exp $ */ /* $NetBSD: wall.c,v 1.6 1994/11/17 07:17:58 jtc Exp $ */ /* @@ -116,11 +116,11 @@ main(int argc, char **argv) makemsg(*argv); if (unveil(_PATH_UTMP, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_UTMP); if (unveil(_PATH_DEV, "w") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_DEV); if (unveil(_PATH_DEVDB, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_DEVDB); if (pledge("stdio rpath wpath getpw proc", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c index a625d440582..c1582a0675e 100644 --- a/usr.bin/who/who.c +++ b/usr.bin/who/who.c @@ -1,4 +1,4 @@ -/* $OpenBSD: who.c,v 1.29 2020/08/27 15:20:31 semarie Exp $ */ +/* $OpenBSD: who.c,v 1.30 2021/07/12 15:09:20 beck Exp $ */ /* $NetBSD: who.c,v 1.4 1994/12/07 04:28:49 jtc Exp $ */ /* @@ -113,7 +113,7 @@ main(int argc, char *argv[]) if (show_quick) { only_current_term = show_term = show_idle = show_labels = 0; } - + if (show_term) hostwidth -= 2; if (show_idle) @@ -123,10 +123,10 @@ main(int argc, char *argv[]) output_labels(); if (unveil(_PATH_UTMP, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_UTMP); if (show_term || show_idle) { if (unveil(_PATH_DEV, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", _PATH_DEV); } switch (argc) { case 0: /* who */ @@ -138,7 +138,7 @@ main(int argc, char *argv[]) who_am_i(ufp); } else if (show_quick) { int count = 0; - + while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) { if (*usr.ut_name && *usr.ut_line) { (void)printf("%-*.*s ", NAME_WIDTH, @@ -159,7 +159,7 @@ main(int argc, char *argv[]) break; case 1: /* who utmp_file */ if (unveil(*argv, "r") == -1) - err(1, "unveil"); + err(1, "unveil %s", *argv); if (pledge("stdio rpath getpw", NULL) == -1) err(1, "pledge"); ufp = file(*argv); |