Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2012 18:23:09 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 219798 for review
Message-ID:  <201211151823.qAFIN9J9069862@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219798?ac=10

Change 219798 by brooks@brooks_zenith on 2012/11/15 18:22:46

	Only read cover slides for the cheripoint image.
	Invoke cheripoint with -f so it can handle exploits in the
	unsandboxed mode.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/ctsrd/pictview/pictview.c#7 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/ctsrd/pictview/pictview.c#7 (text+ko) ====

@@ -41,6 +41,7 @@
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <fnmatch.h>
 #include <libutil.h>
 #include <poll.h>
 #include <signal.h>
@@ -428,6 +429,9 @@
       /* XXX: doesn't support symlinks */
       if (entry->d_type != DT_REG)
 	continue;
+      /* Ignore all files other than covers. */
+      if (fnmatch("*-cover-*.png", entry->d_name, 0) != 0)
+	continue;
       if (slide_nimages == maxslides) {
         maxslides *= 2;
         slidenames = realloc(slidenames, sizeof(*slidenames) * maxslides);
@@ -790,7 +794,7 @@
       syslog(LOG_ALERT, "login_tty failed in child: %s", strerror(errno));
       err(1, "tty_login");
     }
-    execl("/usr/bin/cheripoint", "cheripoint", slide_dir, NULL);
+    execl("/usr/bin/cheripoint", "cheripoint", "-f", slide_dir, NULL);
     syslog(LOG_ALERT, "exec of /usr/bin/cheripoint failed: %s", strerror(errno));
     err(1, "execl()");
   }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211151823.qAFIN9J9069862>