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.master
parent
a989e156a1
commit
c97a9eb870
8
chat.c
8
chat.c
|
@ -157,7 +157,6 @@ static void unveilAll(const char *trust, const char *cert, const char *priv) {
|
||||||
const char *path;
|
const char *path;
|
||||||
const char *perm;
|
const char *perm;
|
||||||
} paths[] = {
|
} paths[] = {
|
||||||
{ "/usr/share/terminfo", "r" },
|
|
||||||
{ tls_default_ca_cert_file(), "r" },
|
{ tls_default_ca_cert_file(), "r" },
|
||||||
};
|
};
|
||||||
for (size_t i = 0; i < ARRAY_LEN(paths); ++i) {
|
for (size_t i = 0; i < ARRAY_LEN(paths); ++i) {
|
||||||
|
@ -306,15 +305,16 @@ int main(int argc, char *argv[]) {
|
||||||
editCompleteAdd();
|
editCompleteAdd();
|
||||||
commandCompleteAdd();
|
commandCompleteAdd();
|
||||||
|
|
||||||
|
ircConfig(insecure, trust, cert, priv);
|
||||||
|
|
||||||
|
uiInitEarly();
|
||||||
|
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
if (self.restricted) unveilAll(trust, cert, priv);
|
if (self.restricted) unveilAll(trust, cert, priv);
|
||||||
int error = pledge("stdio rpath wpath cpath inet dns tty proc exec", NULL);
|
int error = pledge("stdio rpath wpath cpath inet dns tty proc exec", NULL);
|
||||||
if (error) err(EX_OSERR, "pledge");
|
if (error) err(EX_OSERR, "pledge");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ircConfig(insecure, trust, cert, priv);
|
|
||||||
|
|
||||||
uiInitEarly();
|
|
||||||
if (save) {
|
if (save) {
|
||||||
uiLoad(save);
|
uiLoad(save);
|
||||||
atexit(exitSave);
|
atexit(exitSave);
|
||||||
|
|
Loading…
Reference in New Issue