Date: Thu, 28 Apr 2016 01:40:47 +0000 (UTC) From: Jamie Gritton <jamie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298729 - stable/10/usr.sbin/jail Message-ID: <201604280140.u3S1elDp022029@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jamie Date: Thu Apr 28 01:40:47 2016 New Revision: 298729 URL: https://svnweb.freebsd.org/changeset/base/298729 Log: MFC r298562: Make jail(8) interpret escape codes in fstab the same as getfsent(3). PR: 208663 Modified: stable/10/usr.sbin/jail/command.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/command.c ============================================================================== --- stable/10/usr.sbin/jail/command.c Thu Apr 28 01:31:07 2016 (r298728) +++ stable/10/usr.sbin/jail/command.c Thu Apr 28 01:40:47 2016 (r298729) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <vis.h> #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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604280140.u3S1elDp022029>