Date: Mon, 1 Apr 2019 18:17:48 +0000 (UTC) From: Enji Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r345772 - projects/capsicum-test/contrib/capsicum-test Message-ID: <201904011817.x31IHm8B068458@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904011817.x31IHm8B068458>