pigz starts with "stdio rpath wpath cpath fattr chown" like base gzip(1).

For `g.pipeout' aka. -c --stdout and `g.decode == 2' aka. -t --test,
pigz drops to "stdio rpath cpath" while gzip uses "stdio rpath".

The original pledge diff added "cpath" for the case where pigz's signal
handler unlink(2)s output files, but this is actually not needed since
-c and -t never open any file for output/writing.

Drop "cpath" to match gzip behaviour.
Do the same for `g.list' aka. -l --list.

Tests pass and pigz keeps working for me.
Feedback? OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/archivers/pigz/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    11 Mar 2022 18:16:23 -0000      1.13
+++ Makefile    20 Jan 2023 18:21:45 -0000
@@ -6,7 +6,7 @@ COMMENT =       parallel implementation of gzi
 DISTNAME =     pigz-2.7
 CATEGORIES =   archivers
 HOMEPAGE =     https://zlib.net/pigz/
-REVISION =     0
+REVISION =     1
 
 MAINTAINER =   Klemens Nanni <[email protected]>
 
Index: patches/patch-pigz_c
===================================================================
RCS file: /cvs/ports/archivers/pigz/patches/patch-pigz_c,v
retrieving revision 1.5
diff -u -p -r1.5 patch-pigz_c
--- patches/patch-pigz_c        11 Mar 2022 18:16:23 -0000      1.5
+++ patches/patch-pigz_c        19 Jan 2023 23:12:18 -0000
@@ -33,8 +33,8 @@ Index: pigz.c
                  argv[n] = NULL;         // remove if option
          option(NULL);                   // check for missing parameter
 +
-+        if (g.pipeout || g.decode == 2)
-+            if (pledge("stdio rpath cpath", NULL) == -1) {
++        if (g.pipeout || g.decode == 2 || g.list)
++            if (pledge("stdio rpath", NULL) == -1) {
 +                complain("pledge");
 +                exit(1);
 +            }

Reply via email to