gzip violates wpath if you tell it to extract stdin and restore the original filename.
The original mail didn't go through after 12 hours so I'm resending it, sorry if you get 2. Index: regress/usr.bin/gzip/Makefile =================================================================== RCS file: /cvs/src/regress/usr.bin/gzip/Makefile,v retrieving revision 1.2 diff -u -p -u -p -r1.2 Makefile --- regress/usr.bin/gzip/Makefile 22 Jun 2017 16:10:34 -0000 1.2 +++ regress/usr.bin/gzip/Makefile 7 Jul 2022 21:38:25 -0000 @@ -140,4 +140,13 @@ run-regress-owner-unzip: ${SUDO} gunzip owner.gz ls -l owner | grep ' nobody *nobody ' +# Test pledge violations + +REGRESS_TARGETS+= run-regress-wpath +run-regress-wpath: + @echo "\n==== $@ ====" + gzip -c /etc/rc >rc.gz + # uncompress stdin to its original filename + gzip -dN <rc.gz + .include <bsd.regress.mk> Index: usr.bin/compress/main.c =================================================================== RCS file: /cvs/src/usr.bin/compress/main.c,v retrieving revision 1.100 diff -u -p -u -p -r1.100 main.c --- usr.bin/compress/main.c 10 Apr 2022 18:05:39 -0000 1.100 +++ usr.bin/compress/main.c 7 Jul 2022 21:38:26 -0000 @@ -338,7 +338,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (cflag || testmode || (!oflag && argc == 0)) + if (cflag || testmode || (storename != 1 && !oflag && argc == 0)) if (pledge("stdio rpath", NULL) == -1) err(1, "pledge");