From 462d6a8eb61ae8ff15525741a2f75ae453e9485f Mon Sep 17 00:00:00 2001 From: jamie Date: Thu, 28 Apr 2016 01:40:47 +0000 Subject: [PATCH] MFC r298562: Make jail(8) interpret escape codes in fstab the same as getfsent(3). PR: 208663 git-svn-id: svn://svn.freebsd.org/base/stable/10@298729 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/jail/command.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index 805251f3e..a374604f7 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "jailp.h" @@ -445,8 +446,14 @@ run_command(struct cfjail *j) strcpy(comcs, comstring->s); argc = 0; for (cs = strtok(comcs, " \t\f\v\r\n"); cs && argc < 4; - cs = strtok(NULL, " \t\f\v\r\n")) + cs = strtok(NULL, " \t\f\v\r\n")) { + if (argc <= 1 && strunvis(cs, cs) < 0) { + jail_warnx(j, "%s: %s: fstab parse error", + j->intparams[comparam]->name, comstring->s); + return -1; + } argv[argc++] = cs; + } if (argc == 0) return 0; if (argc < 3) { -- 2.45.0