git: 15261be6003c - stable/14 - leave(1): Capsicumise
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 29 Jan 2025 12:35:55 UTC
The branch stable/14 has been updated by oshogbo:
URL: https://cgit.FreeBSD.org/src/commit/?id=15261be6003cd73e43848e805b893bbd1fe542bb
commit 15261be6003cd73e43848e805b893bbd1fe542bb
Author: Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2024-10-27 16:34:33 +0000
Commit: Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2025-01-29 09:51:15 +0000
leave(1): Capsicumise
Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: oshogbo
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1499
(cherry picked from commit 24a7303821ad2343b9239ab3d12a569a70a2b99a)
---
usr.bin/leave/leave.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c
index f9e40be124a0..ccea5d93d460 100644
--- a/usr.bin/leave/leave.c
+++ b/usr.bin/leave/leave.c
@@ -49,6 +49,8 @@ static char sccsid[] = "@(#)leave.c 8.1 (Berkeley) 6/6/93";
#include <time.h>
#include <unistd.h>
+#include <capsicum_helpers.h>
+
static void doalarm(u_int);
static void usage(void) __dead2;
@@ -73,6 +75,10 @@ main(int argc, char **argv)
if (setlocale(LC_TIME, "") == NULL)
warn("setlocale");
+ caph_cache_catpages();
+ if (caph_limit_stdio() < 0 || caph_enter() < 0)
+ err(EXIT_FAILURE, "capsicum");
+
if (argc < 2) {
#define MSG1 "When do you have to leave? "
(void)write(STDOUT_FILENO, MSG1, sizeof(MSG1) - 1);