From 97f44133479de6b5e5394056ee8e9d66cd7b7340 Mon Sep 17 00:00:00 2001 From: chrysos349 Date: Thu, 15 Feb 2024 15:41:00 +0300 Subject: [PATCH] 7zip: fix compatib with p7zip --- .../patches/fix-compatib-with-p7zip.patch | 41 +++++++++++++++++++ srcpkgs/7zip/template | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/7zip/patches/fix-compatib-with-p7zip.patch diff --git a/srcpkgs/7zip/patches/fix-compatib-with-p7zip.patch b/srcpkgs/7zip/patches/fix-compatib-with-p7zip.patch new file mode 100644 index 0000000000000..48f643bc66951 --- /dev/null +++ b/srcpkgs/7zip/patches/fix-compatib-with-p7zip.patch @@ -0,0 +1,41 @@ +From: Dario Faggioli +Date: Wed Jan 26 04:01:09 AM CET 2022 +Subject: [PATCH] Console: Avoid terminating on failed password check + +File-roller (i.e., GNOME's Archive Manager), which was working fine +with p7zip and p7zip-full, does not work well with 7zip. More specifically, +it is not possible to open or extract a password protected archive, for +which also the list of the files in the archive itself has been hidden. + +This seems to happen because now GetPassword_HRESULT() does some kind of +error checking, and depending on the results, cause its calling function +to return with an error, which in turns terminates the 7zz program in +a way that file-roller interpretes as a critical error, and everything +stops. + +On the other hand, in p7zip-full, the GetPassword() function wasn't +doing this. There's still a failure, but one that triggers File-roller +to ask the password of the archive, and once that is provided everything +works. + +From a CLI perspecvive, nothing changes, and things still work fine and +in the exact same way, no matter whether or not this patch is applied. + +Signed-off-by: Dario Faggioli +--- + OpenCallbackConsole.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: 7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +=================================================================== +--- 7zip.orig/CPP/7zip/UI/Console/OpenCallbackConsole.cpp ++++ 7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +@@ -87,7 +87,7 @@ HRESULT COpenCallbackConsole::Open_Crypt + if (!PasswordIsDefined) + { + ClosePercents(); +- RINOK(GetPassword_HRESULT(_so, Password)) ++ GetPassword_HRESULT(_so, Password); + PasswordIsDefined = true; + } + return StringToBstr(Password, password); diff --git a/srcpkgs/7zip/template b/srcpkgs/7zip/template index 9f8add8040688..708f6cfe3c28c 100644 --- a/srcpkgs/7zip/template +++ b/srcpkgs/7zip/template @@ -1,7 +1,7 @@ # Template file for '7zip' pkgname=7zip version=23.01 -revision=1 +revision=2 short_desc="File archiver with a high compression ratio" maintainer="Roberto Ricci " license="LGPL-2.1-or-later, BSD-3-Clause"