On Wed, Feb 03, 2016 at 09:42:55AM +0300, Andre S wrote:
> p7zip-15.09p3
> 
> Core dumped when used "l" command to list contents of password protected
> archive.
> 
> Core dumped when used "t" command to test integrity of password protected
> archive.
> 
> $ 7z a -p test.7z test.txt
> Success.
> 
> $ 7z l test.7z
> Enter password (will not be echoed):Abort trap (core dumped)
> 
> $ 7z t test.7z
> Enter password (will not be echoed):Abort trap (core dumped)
 
Ouch. Thanks for the report. And for the fix, which broadens
the applicable secondary pledges to include tty.

In testing on amd64, I do get different results.  The list command 
does not prompt for a password.  

However the pledge() for list is also the pledge for stdout extractions, so 
your recommendation to expand that pledge is fine.  If you would be kind 
enough to post your architecture, that may be helpful in trying to recreate
the same results which occurred for you.

I was unable to apply your patch directly due to white space
alignment. I applied your recommendations and have posted the
equivalent patch below, using mutt, which is less likely to chew
on unified diffs than some other Email applications.

OK $MAINTAINER.

Index: Makefile
===================================================================
RCS file: /systems/cvs/ports/archivers/p7zip/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- Makefile    31 Jan 2016 22:29:37 -0000      1.30
+++ Makefile    3 Feb 2016 11:21:33 -0000
@@ -6,7 +6,7 @@ COMMENT-main=   file archiver with high co
 COMMENT-rar=   rar modules for p7zip
 
 V=             15.09
-REVISION=      3
+REVISION=      4
 DISTNAME=      p7zip_${V}_src_all
 PKGNAME=       p7zip-${V}
 PKGNAME-main=  p7zip-${V}
Index: patches/patch-CPP_7zip_UI_Console_Main_cpp
===================================================================
RCS file: 
/systems/cvs/ports/archivers/p7zip/patches/patch-CPP_7zip_UI_Console_Main_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-CPP_7zip_UI_Console_Main_cpp
--- patches/patch-CPP_7zip_UI_Console_Main_cpp  31 Jan 2016 22:29:37 -0000      
1.3
+++ patches/patch-CPP_7zip_UI_Console_Main_cpp  3 Feb 2016 11:22:33 -0000
@@ -88,7 +88,7 @@ Pledge archivers/p7zip main executables
 +#ifdef PLEDGE_DEBUG
 +          printf("reduced pledge: test stdout\n");
 +#endif
-+          if (pledge("stdio rpath", NULL) == -1) {
++          if (pledge("stdio rpath tty", NULL) == -1) {
 +              perror("pledge");
 +              exit(2);
 +        }
@@ -106,7 +106,7 @@ Pledge archivers/p7zip main executables
 +  printf("reduced pledge: list\n");
 +#endif
 +
-+  if (pledge("stdio rpath", NULL) == -1) {
++  if (pledge("stdio rpath tty", NULL) == -1) {
 +    perror("pledge");
 +    exit(2);
 +  }

Reply via email to