From owner-svn-ports-all@freebsd.org Tue Jun 6 21:34:37 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E0B8BF55AC; Tue, 6 Jun 2017 21:34:37 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E82B7BEE6; Tue, 6 Jun 2017 21:34:37 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v56LYa9c016267; Tue, 6 Jun 2017 21:34:36 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v56LYaq5016265; Tue, 6 Jun 2017 21:34:36 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201706062134.v56LYaq5016265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Tue, 6 Jun 2017 21:34:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r442808 - in head/math/moo: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2017 21:34:37 -0000 Author: skreuzer Date: Tue Jun 6 21:34:35 2017 New Revision: 442808 URL: https://svnweb.freebsd.org/changeset/ports/442808 Log: Add support for capsicum Modified: head/math/moo/Makefile head/math/moo/files/patch-Makefile head/math/moo/files/patch-moo.y Modified: head/math/moo/Makefile ============================================================================== --- head/math/moo/Makefile Tue Jun 6 21:20:56 2017 (r442807) +++ head/math/moo/Makefile Tue Jun 6 21:34:35 2017 (r442808) @@ -3,6 +3,7 @@ PORTNAME= moo PORTVERSION= 1.5 +PORTREVISION= 1 CATEGORIES= math MAINTAINER= skreuzer@FreeBSD.org @@ -15,6 +16,10 @@ GH_ACCOUNT= raylai GH_TAGNAME= ${PORTVERSION} PLIST_FILES= bin/moo man/man1/moo.1.gz + +.if exists(/usr/include/sys/capsicum.h) +CFLAGS+= -DHAVE_CAPSICUM +.endif MAKE_JOBS_UNSAFE= yes Modified: head/math/moo/files/patch-Makefile ============================================================================== --- head/math/moo/files/patch-Makefile Tue Jun 6 21:20:56 2017 (r442807) +++ head/math/moo/files/patch-Makefile Tue Jun 6 21:34:35 2017 (r442808) @@ -1,4 +1,4 @@ ---- Makefile.orig 2017-06-01 18:24:01 UTC +--- Makefile.orig 2016-06-04 10:05:27 UTC +++ Makefile @@ -1,14 +1,14 @@ PROG= moo Modified: head/math/moo/files/patch-moo.y ============================================================================== --- head/math/moo/files/patch-moo.y Tue Jun 6 21:20:56 2017 (r442807) +++ head/math/moo/files/patch-moo.y Tue Jun 6 21:34:35 2017 (r442808) @@ -1,7 +1,19 @@ --- moo.y.orig 2016-06-04 10:05:27 UTC +++ moo.y -@@ -34,7 +34,7 @@ static int used_oct; +@@ -4,6 +4,11 @@ + * Public domain. + */ ++#ifdef HAVE_CAPSICUM ++#include ++#include ++#endif ++ + #include + #include + #include +@@ -34,7 +39,7 @@ static int used_oct; + static void divbyzero(void); static void printnum(int64_t); -__dead static void usage(void); @@ -9,17 +21,27 @@ void yyerror(char *); int yylex(void); int yyparse(void); -@@ -317,9 +317,6 @@ main(int argc, char *argv[]) +@@ -315,10 +320,16 @@ getnum(const char *nptr) + int + main(int argc, char *argv[]) { - int ch; +- int ch; ++#ifdef HAVE_CAPSICUM ++ if (caph_limit_stdio() < 0) ++ err(1, "unable to limit capabilities for stdio"); - if (pledge("stdio tmppath", NULL) == -1) - err(1, "pledge"); -- ++ caph_cache_catpages(); ++ if (cap_enter() < 0 && errno != ENOSYS) ++ err(1, "unable to enter capability mode"); ++#endif ++ ++ int ch; + while ((ch = getopt(argc, argv, "0123456789b:lsuw:")) != -1) switch (ch) { - /* -@@ -403,9 +400,6 @@ DONEPARSING: +@@ -403,9 +414,6 @@ DONEPARSING: yyin = sfp; }