Index | Thread | Search

From:
Scott Cheloha <scottcheloha@gmail.com>
Subject:
tty(1): return status 2 if unveil(2) or pledge(2) fail
To:
tech@openbsd.org
Date:
Sun, 5 May 2024 15:28:42 -0500

Download raw body.

Thread
On error, tty(1) returns >1, not 1.

ok?

Index: tty.c
===================================================================
RCS file: /cvs/src/usr.bin/tty/tty.c,v
diff -u -p -r1.13 tty.c
--- tty.c	4 Dec 2022 23:50:50 -0000	1.13
+++ tty.c	5 May 2024 20:24:48 -0000
@@ -57,9 +57,9 @@ main(int argc, char *argv[])
 	}
 
 	if (unveil(_PATH_DEVDB, "r") == -1)
-		err(1, "unveil %s", _PATH_DEVDB);
+		err(2, "unveil %s", _PATH_DEVDB);
 	if (pledge("stdio rpath", NULL) == -1)
-		err(1, "pledge");
+		err(2, "pledge");
 
 	t = ttyname(STDIN_FILENO);
 	if (!sflag)