From d9388fa2a8672831075fa0e48dff35033347a4af Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 20 Jul 2021 13:25:04 -0400 Subject: FreeBSD: Revert caph_enter(3) call to cap_enter(2) caph_enter(3) is the same as cap_enter(2) except that it returns success even if the kernel does not support capability mode. Since we only enter capability mode when explicitly requested by the restrict option, it should fail loudly if it is not supported. On the other hand, we make calls to caph_rights_limit(3) and friends in some places regardless of whether we actually enter capability mode (to keep the code simple), so those should continue to succeed even if capability mode is not supported. --- chat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chat.c b/chat.c index 3141052..f5004e7 100644 --- a/chat.c +++ b/chat.c @@ -201,8 +201,8 @@ static void sandboxLate(int irc) { caph_cache_tzdata(); gmtime(&(time_t) { time(NULL) }); - error = caph_enter(); - if (error) err(EX_OSERR, "caph_enter"); + error = cap_enter(); + if (error) err(EX_OSERR, "cap_enter"); } #else -- cgit 1.4.1