[UPDATE] pledge textproc/jq

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[UPDATE] pledge textproc/jq

Doug Hogan
Hi,

Diff for adding pledge to jq as it is often used with output from remote
servers.

Index: textproc/jq/Makefile
===================================================================
RCS file: /cvsmirror/ports/textproc/jq/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- textproc/jq/Makefile 24 Oct 2015 10:25:39 -0000 1.6
+++ textproc/jq/Makefile 17 Jan 2016 17:05:02 -0000
@@ -4,6 +4,7 @@ COMMENT = lightweight and flexible comm
 
 V = 1.5
 DISTNAME = jq-$V
+REVISION = 0
 
 SHARED_LIBS += jq                        1.0 # 1.4
 
@@ -14,6 +15,7 @@ HOMEPAGE = http://stedolan.github.io/jq
 # MIT (code), CC-BY-3.0 (docs)
 PERMIT_PACKAGE_CDROM = Yes
 
+# uses pledge(2)
 WANTLIB += c m
 
 MASTER_SITES = https://github.com/stedolan/jq/releases/download/jq-$V/
Index: textproc/jq/patches/patch-main_c
===================================================================
RCS file: textproc/jq/patches/patch-main_c
diff -N textproc/jq/patches/patch-main_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ textproc/jq/patches/patch-main_c 17 Jan 2016 17:12:20 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+--- main.c.orig Sat Aug 15 21:37:35 2015
++++ main.c Sun Jan 17 09:12:05 2016
+@@ -176,6 +176,11 @@ int main(int argc, char* argv[]) {
+   int badwrite;
+   jv program_arguments = jv_array();
+
++  if (pledge("stdio rpath", NULL) == -1) {
++    perror("pledge");
++    exit(1);
++  }
++
+ #ifdef WIN32
+   SetConsoleOutputCP(CP_UTF8);
+   fflush(stdout);

Reply | Threaded
Open this post in threaded view
|

Re: [UPDATE] pledge textproc/jq

Stuart Henderson-6
On 2016/01/17 10:20, Doug Hogan wrote:
> Diff for adding pledge to jq as it is often used with output from remote
> servers.

Since it's hard to test everything in the jq language and this is quite
a moving target from release to release, could you add some comments to
the Makefile with at least a warning about this and ideally some tips
on testing please?