diff options
| author | C. McEnroe | 2021-06-24 17:05:12 -0400 | 
|---|---|---|
| committer | C. McEnroe | 2021-06-25 11:50:14 -0400 | 
| commit | 16b34e5cd2135c480ac661a9edcf913dfcabf87d (patch) | |
| tree | a58e60eb74946814e24151b65e2c7d970ca1a7f4 | |
| parent | fece6e6eb620068d352ceb0433c3d74d8c22f35b (diff) | |
FreeBSD: Enter capabilities mode if restricted
| -rw-r--r-- | chat.c | 11 | 
1 files changed, 11 insertions, 0 deletions
| @@ -46,6 +46,10 @@  #include <tls.h>  #include <unistd.h> +#ifdef __FreeBSD__ +#include <sys/capsicum.h> +#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"); | 
