svn commit: r298562 - head/usr.sbin/jail

Jamie Gritton jamie at FreeBSD.org
Mon Apr 25 03:24:49 UTC 2016


Author: jamie
Date: Mon Apr 25 03:24:48 2016
New Revision: 298562
URL: https://svnweb.freebsd.org/changeset/base/298562

Log:
  Make jail(8) interpret escape codes in fstab the same as getfsent(3).
  
  PR:		208663
  MFC after:	3 days

Modified:
  head/usr.sbin/jail/command.c

Modified: head/usr.sbin/jail/command.c
==============================================================================
--- head/usr.sbin/jail/command.c	Mon Apr 25 03:14:55 2016	(r298561)
+++ head/usr.sbin/jail/command.c	Mon Apr 25 03:24:48 2016	(r298562)
@@ -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) {


More information about the svn-src-head mailing list