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@
-/* $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 $ */
/*
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);