projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
459b3e8
)
ujail-console: add missing error handling discovered by coverity
author
Daniel Golle
<daniel@makrotopia.org>
Fri, 13 Aug 2021 18:14:12 +0000
(19:14 +0100)
committer
Daniel Golle
<daniel@makrotopia.org>
Sat, 14 Aug 2021 17:58:45 +0000
(18:58 +0100)
Coverity CID:
1490106
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/console.c
patch
|
blob
|
history
diff --git
a/jail/console.c
b/jail/console.c
index 588d24114bc499117a720b9be48161f2328e4cbe..498756fc60aa47bf992ffc54d957cd9f456dbaae 100644
(file)
--- a/
jail/console.c
+++ b/
jail/console.c
@@
-163,9
+163,16
@@
int main(int argc, char **argv)
ubus_free(ctx);
return -1;
}
-
setup_tios(server_fd, &oldtermios);
+
tty_fd = open("/dev/tty", O_RDWR);
+ if (tty_fd < 0) {
+ fprintf(stderr, "can't open local console!\n");
+ close(server_fd);
+ close(client_fd);
+ ubus_free(ctx);
+ return -1;
+ }
setup_tios(tty_fd, &oldtermios);
/* register server-side with procd */