diff options
author | jamie <jamie@FreeBSD.org> | 2016-04-25 03:24:48 +0000 |
---|---|---|
committer | jamie <jamie@FreeBSD.org> | 2016-04-25 03:24:48 +0000 |
commit | 85f9eceb67100b2c7ee87fb45f702a57126b126f (patch) | |
tree | c46beadf17c2e3b2369ba203d8cf641289c7a1ef /usr.sbin/jail | |
parent | b622a5ef08e12b1134ca40811623e1b58a2dbf33 (diff) | |
download | FreeBSD-src-85f9eceb67100b2c7ee87fb45f702a57126b126f.zip FreeBSD-src-85f9eceb67100b2c7ee87fb45f702a57126b126f.tar.gz |
Make jail(8) interpret escape codes in fstab the same as getfsent(3).
PR: 208663
MFC after: 3 days
Diffstat (limited to 'usr.sbin/jail')
-rw-r--r-- | usr.sbin/jail/command.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index 7132a5f..8dc6d3ec 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <vis.h> #include "jailp.h" @@ -444,8 +445,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) { |