about summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
authorKlemens Nanni <klemens@posteo.de>2021-06-07 23:40:40 +0000
committerJune McEnroe <june@causal.agency>2021-06-09 09:21:51 -0400
commitc97a9eb8707bee6b558b1b2bad860bbdc1253588 (patch)
tree504b0f30d686b8c1443a8fa84a9c50b0e3c45a1a /chat.c
parentOpenBSD: hoist -o/printCert code to simplify (diff)
downloadcatgirl-c97a9eb8707bee6b558b1b2bad860bbdc1253588.tar.gz
catgirl-c97a9eb8707bee6b558b1b2bad860bbdc1253588.zip
OpenBSD: unveil after ncurses(3) init to support TERMINFO
initscr(3) in uiInitEarly() attempts more than /usr/share/terminfo/, see
`mandoc -O tag=TERMINFO ncurses`.

Even though non-default terminfo handling seems rare and it is unlikely
to have ever caused a problem for catgirl users on OpenBSD, the current
is still wrong by oversimplifying it.

Avoid the entire curses/unveil clash by setting up the screen before
unveiling.
Diffstat (limited to 'chat.c')
-rw-r--r--chat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/chat.c b/chat.c
index b62840f..19ca3d3 100644
--- a/chat.c
+++ b/chat.c
@@ -157,7 +157,6 @@ static void unveilAll(const char *trust, const char *cert, const char *priv) {
 		const char *path;
 		const char *perm;
 	} paths[] = {
-		{ "/usr/share/terminfo", "r" },
 		{ tls_default_ca_cert_file(), "r" },
 	};
 	for (size_t i = 0; i < ARRAY_LEN(paths); ++i) {
@@ -306,15 +305,16 @@ int main(int argc, char *argv[]) {
 	editCompleteAdd();
 	commandCompleteAdd();
 
+	ircConfig(insecure, trust, cert, priv);
+
+	uiInitEarly();
+
 #ifdef __OpenBSD__
 	if (self.restricted) unveilAll(trust, cert, priv);
 	int error = pledge("stdio rpath wpath cpath inet dns tty proc exec", NULL);
 	if (error) err(EX_OSERR, "pledge");
 #endif
 
-	ircConfig(insecure, trust, cert, priv);
-
-	uiInitEarly();
 	if (save) {
 		uiLoad(save);
 		atexit(exitSave);