From a989e156a14462a1bb6c78f6ead115ddd04fed8f Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Mon, 7 Jun 2021 23:40:39 +0000 Subject: OpenBSD: hoist -o/printCert code to simplify Nothing but the TLS handshake is required, so skip all other setup. On OpenBSD, unveil() handling needs fixing which will involve code reshuffling -- this is the first related but standalone step. Also pledge this one-off code path individually such with simpler and tighter promises while here. --- chat.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/chat.c b/chat.c index b3990f3..b62840f 100644 --- a/chat.c +++ b/chat.c @@ -266,6 +266,19 @@ int main(int argc, char *argv[]) { } if (!host) errx(EX_USAGE, "host required"); + if (printCert) { +#ifdef __OpenBSD__ + unveilAll(trust, cert, priv); + int error = pledge("stdio rpath inet dns", NULL); + if (error) err(EX_OSERR, "pledge"); +#endif + ircConfig(insecure, trust, cert, priv); + ircConnect(bind, host, port); + ircPrintCert(); + ircClose(); + return EX_OK; + } + if (!nick) nick = getenv("USER"); if (!nick) errx(EX_CONFIG, "USER unset"); if (!user) user = nick; @@ -300,12 +313,6 @@ int main(int argc, char *argv[]) { #endif ircConfig(insecure, trust, cert, priv); - if (printCert) { - ircConnect(bind, host, port); - ircPrintCert(); - ircClose(); - return EX_OK; - } uiInitEarly(); if (save) { -- cgit 1.4.1 cgit-pink/commit/tests/t0104-tree.sh?h=1.4.1&id=b44dd95f13f039cd9bee301655150ff765d9555e&follow=1'>commit diff
path: root/tests/t0104-tree.sh (unfollow)
Commit message (Expand)Author
2015-08-13ui-shared: extract date formatting to a functionJohn Keeping
2015-08-13filter: don't use dlsym unnecessarilyJohn Keeping
2015-08-13ui-tree: use "sane" isgraph()John Keeping
2015-08-13cgit.h: move stdbool.h from ui-shared.hJohn Keeping
2015-08-13cache.c: fix header orderJohn Keeping
2015-08-13configfile.c: don't include system headers directlyJohn Keeping
2015-08-13Remove redundant includesJohn Keeping
2015-08-13Makefile: include Git's config.mak.unameJohn Keeping
2015-08-13tests: allow shell to be overriddenJohn Keeping
2015-08-13redirect: cleanlinessJason A. Donenfeld
2015-08-13redirect: be more careful for different cgi setupsJason A. Donenfeld
2015-08-12ui-log: fix double countingJohn Keeping
2015-08-12log: allow users to follow a fileJohn Keeping
2015-08-12shared: make cgit_diff_tree_cb publicJohn Keeping
2015-08-12t0110: Chain together using &&Jason A. Donenfeld
2015-08-12about: always ensure page has a trailing slashJason A. Donenfeld
2015-08-12filters: apply HTML escapingLazaros Koromilas
2015-08-12git: update to v2.5.0Christian Hesse
2015-08-12Fix processing of repo.hide and repo.ignoreDaniel Reichelt