From: mestre Date: Sat, 11 Aug 2018 10:58:39 +0000 (+0000) Subject: this one was my fault, when an error occurrs on mesg(1) it must exit with error X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c2f279245ebac5655292ee760fc5d0712f47ec35;p=openbsd this one was my fault, when an error occurrs on mesg(1) it must exit with error values >1 since the return value 1 is used to indicate that messages have been disallowed. while here also s/unveil/pledge on err(3). OK tb@ kn@ deraadt@ --- diff --git a/usr.bin/mesg/mesg.c b/usr.bin/mesg/mesg.c index a2dc944ed5c..1de4aa799bc 100644 --- a/usr.bin/mesg/mesg.c +++ b/usr.bin/mesg/mesg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mesg.c,v 1.13 2018/08/03 06:57:34 deraadt Exp $ */ +/* $OpenBSD: mesg.c,v 1.14 2018/08/11 10:58:39 mestre Exp $ */ /* $NetBSD: mesg.c,v 1.4 1994/12/23 07:16:32 jtc Exp $ */ /* @@ -65,9 +65,9 @@ main(int argc, char *argv[]) err(2, "ttyname"); if (unveil(tty, "rw") == -1) - err(1, "unveil"); + err(2, "unveil"); if (pledge("stdio rpath fattr", NULL) == -1) - err(1, "unveil"); + err(2, "unveil"); if (stat(tty, &sb) < 0) err(2, "%s", tty);