summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--chat.c19
1 files 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) {
'/pounce/commit/README.7?h=2.4&id=3edd75d21cf0dd7f93db74431dd73c23f6f9cc55&follow=1'>Document rationaleJune McEnroe 2019-10-26Handle nick collisionJune McEnroe 2019-10-26Wait for AUTHENTICATE + from serverJune McEnroe 2019-10-26Respond to PING with same parameterJune McEnroe 2019-10-26Add undocumented flag to disable verificationJune McEnroe 2019-10-26Do not require RPL_ISUPPORT for stateReadyJune McEnroe 2019-10-26Implement graceful shutdownJune McEnroe 2019-10-26Require PASS before USERJune McEnroe Prevent creating a ring consumer without authentication. 2019-10-26Track channel topicsJune McEnroe 2019-10-26Set AWAY when no clients are connectedJune McEnroe 2019-10-26Add flags to request TOPIC and NAMES on client connectJune McEnroe 2019-10-26OopsJune McEnroe 2019-10-26Disconnect client on unknown commandJune McEnroe During registration, no other commands should be sent. Afterwards, only intercepted commands will get parsed. 2019-10-26Allow reading sensitive information from filesJune McEnroe 2019-10-26Add rc scriptJune McEnroe 2019-10-25Add install and uninstall targetsJune McEnroe 2019-10-25Expand documentationJune McEnroe 2019-10-25Add AGPLv3 notice on client registrationJune McEnroe OwO 2019-10-25Rename project pounceJune McEnroe