From 16b34e5cd2135c480ac661a9edcf913dfcabf87d Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Thu, 24 Jun 2021 17:05:12 -0400 Subject: FreeBSD: Enter capabilities mode if restricted --- chat.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'chat.c') diff --git a/chat.c b/chat.c index 71bfb7b..170094f 100644 --- a/chat.c +++ b/chat.c @@ -46,6 +46,10 @@ #include #include +#ifdef __FreeBSD__ +#include +#endif + #include "chat.h" #ifndef OPENSSL_BIN @@ -314,6 +318,13 @@ int main(int argc, char *argv[]) { if (error) err(EX_OSERR, "pledge"); #endif +#ifdef __FreeBSD__ + if (self.restricted) { + int error = cap_enter(); + if (error) err(EX_OSERR, "cap_enter"); + } +#endif + if (pass) ircFormat("PASS :%s\r\n", pass); if (sasl) ircFormat("CAP REQ :sasl\r\n"); ircFormat("CAP LS\r\n"); -- cgit 1.4.1-2-gfad0