Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Mar 2026 17:06:28 +0000
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Cc:        Faraz Vahedi <kfv@kfv.io>
Subject:   git: 4a4c88533712 - main - from(1): Capsicumise
Message-ID:  <69a47214.3ce5e.51938112@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by oshogbo:

URL: https://cgit.FreeBSD.org/src/commit/?id=4a4c88533712f98a6b8fa04acb319f26aecccc3c

commit 4a4c88533712f98a6b8fa04acb319f26aecccc3c
Author:     Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2024-11-01 11:03:56 +0000
Commit:     Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2026-03-01 17:03:13 +0000

    from(1): Capsicumise
    
    Signed-off-by: Faraz Vahedi <kfv@kfv.io>
    Reviewed by: imp, oshogbo, markj (previous version)
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1491
---
 usr.bin/from/from.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index fb194dcc72d0..da9c6a7583ca 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -31,6 +31,7 @@
 
 #include <sys/types.h>
 
+#include <capsicum_helpers.h>
 #include <ctype.h>
 #include <err.h>
 #include <pwd.h>
@@ -102,6 +103,9 @@ main(int argc, char **argv)
 	else if ((mbox = fopen(file, "r")) == NULL) {
 		errx(EXIT_FAILURE, "can't read %s", file);
 	}
+	if (caph_limit_stdio() < 0 || caph_enter() < 0) {
+		err(EXIT_FAILURE, "capsicum");
+	}
 	for (newline = 1; fgets(buf, sizeof(buf), mbox);) {
 		if (*buf == '\n') {
 			newline = 1;


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69a47214.3ce5e.51938112>