svn commit: r345772 - projects/capsicum-test/contrib/capsicum-test

Enji Cooper ngie at FreeBSD.org
Mon Apr 1 18:17:49 UTC 2019


Author: ngie
Date: Mon Apr  1 18:17:48 2019
New Revision: 345772
URL: https://svnweb.freebsd.org/changeset/base/345772

Log:
  Fix build for Linux
  
  In order for the test to build/run, I needed to add an `Execveat` subclass of
  `Execve`, then use `TEST_F(..)` for the test in order to leverage `exec_prog_`.
  This wasn't caught previously, because FreeBSD lacks an execveat(2) call,
  unlike Linux.
  
  Reported by:	David Drysdale <drysdale at google.com>
  Pull Request:	https://github.com/google/capsicum-test/pull/41 (WIP)

Modified:
  projects/capsicum-test/contrib/capsicum-test/fexecve.cc

Modified: projects/capsicum-test/contrib/capsicum-test/fexecve.cc
==============================================================================
--- projects/capsicum-test/contrib/capsicum-test/fexecve.cc	Mon Apr  1 18:09:26 2019	(r345771)
+++ projects/capsicum-test/contrib/capsicum-test/fexecve.cc	Mon Apr  1 18:17:48 2019	(r345772)
@@ -167,7 +167,12 @@ FORK_TEST_F(FexecveWithScript, CapModeScriptFail) {
 }
 
 #ifdef HAVE_EXECVEAT
-TEST(Execveat, NoUpwardTraversal) {
+class Execveat : public Execve {
+ public:
+  Execveat() : Execve() {}
+};
+
+TEST_F(Execveat, NoUpwardTraversal) {
   char *abspath = realpath(exec_prog_, NULL);
   char cwd[1024];
   getcwd(cwd, sizeof(cwd));


More information about the svn-src-projects mailing list