git: a03b45d38f8f - stable/15 - jail: open the fstab files with fopen("re")
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 10 Jun 2026 04:01:14 UTC
The branch stable/15 has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=a03b45d38f8fc312a7a86c3ac2e4bdcbbad9f4d3
commit a03b45d38f8fc312a7a86c3ac2e4bdcbbad9f4d3
Author: Jan Bramkamp <crest+freebsd@rlwinm.de>
AuthorDate: 2026-05-06 23:28:53 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-06-10 04:00:36 +0000
jail: open the fstab files with fopen("re")
This protects against accidentally leaking them past fork()+exec()
in future refactorings.
PR: 295052
Reviewed by: kevans
(cherry picked from commit 58811b0ae096c134af372bcf475aea1d8d0e3c08)
---
usr.sbin/jail/config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c
index f1e2da215790..188f48732561 100644
--- a/usr.sbin/jail/config.c
+++ b/usr.sbin/jail/config.c
@@ -726,7 +726,7 @@ check_intparams(struct cfjail *j)
TAILQ_FOREACH(s, &j->intparams[IP_MOUNT_FSTAB]->val, tq) {
if (s->len == 0)
continue;
- f = fopen(s->s, "r");
+ f = fopen(s->s, "re");
if (f == NULL) {
jail_warnx(j, "mount.fstab: %s: %s",
s->s, strerror(errno));