artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21e1420
)
tty(1): exit with status 2 if unveil(2) or pledge(2) fail
author
cheloha
<cheloha@openbsd.org>
Mon, 6 May 2024 16:49:46 +0000
(16:49 +0000)
committer
cheloha
<cheloha@openbsd.org>
Mon, 6 May 2024 16:49:46 +0000
(16:49 +0000)
tty(1) returns >1 on error, not 1.
Thread: https://marc.info/?l=openbsd-tech&m=
171494082629111
&w=2
ok deraadt@ guenther@
usr.bin/tty/tty.c
patch
|
blob
|
history
diff --git
a/usr.bin/tty/tty.c
b/usr.bin/tty/tty.c
index
14beca8
..
ae4bc17
100644
(file)
--- a/
usr.bin/tty/tty.c
+++ b/
usr.bin/tty/tty.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: tty.c,v 1.1
3 2022/12/04 23:50:50
cheloha Exp $ */
+/* $OpenBSD: tty.c,v 1.1
4 2024/05/06 16:49:46
cheloha Exp $ */
/* $NetBSD: tty.c,v 1.4 1994/12/07 00:46:57 jtc Exp $ */
/*
@@
-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)