Blame fix-compatib-with-p7zip.patch

Adrian Schröter 60546d
From: Dario Faggioli <dfaggioli@suse.com>
Adrian Schröter 60546d
Date: Wed Jan 26 04:01:09 AM CET 2022
Adrian Schröter 60546d
Subject: [PATCH] Console: Avoid terminating on failed password check
Adrian Schröter 60546d
Adrian Schröter 60546d
File-roller (i.e., GNOME's Archive Manager), which was working fine
Adrian Schröter 60546d
with p7zip and p7zip-full, does not work well with 7zip. More specifically,
Adrian Schröter 60546d
it is not possible to open or extract a password protected archive, for
Adrian Schröter 60546d
which also the list of the files in the archive itself has been hidden.
Adrian Schröter 60546d
Adrian Schröter 60546d
This seems to happen because now GetPassword_HRESULT() does some kind of
Adrian Schröter 60546d
error checking, and depending on the results, cause its calling function
Adrian Schröter 60546d
to return with an error, which in turns terminates the 7zz program in
Adrian Schröter 60546d
a way that file-roller interpretes as a critical error, and everything
Adrian Schröter 60546d
stops.
Adrian Schröter 60546d
Adrian Schröter 60546d
On the other hand, in p7zip-full, the GetPassword() function wasn't
Adrian Schröter 60546d
doing this. There's still a failure, but one that triggers File-roller
Adrian Schröter 60546d
to ask the password of the archive, and once that is provided everything
Adrian Schröter 60546d
works.
Adrian Schröter 60546d
Adrian Schröter 60546d
From a CLI perspecvive, nothing changes, and things still work fine and
Adrian Schröter 60546d
in the exact same way, no matter whether or not this patch is applied.
Adrian Schröter 60546d
Adrian Schröter 60546d
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Adrian Schröter 60546d
---
Adrian Schröter 60546d
 OpenCallbackConsole.cpp |    2 +-
Adrian Schröter 60546d
 1 file changed, 1 insertion(+), 1 deletion(-)
Adrian Schröter 60546d
Adrian Schröter 60546d
diff -Nru 7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp 7zip_2/CPP/7zip/UI/Console/OpenCallbackConsole.cpp
Adrian Schröter 60546d
--- 7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp	2017-02-18 00:42:14.000000000 +0100
Adrian Schröter 60546d
+++ 7zip_2/CPP/7zip/UI/Console/OpenCallbackConsole.cpp	2022-01-26 08:40:15.616512459 +0100
Adrian Schröter 60546d
@@ -87,7 +87,7 @@
Adrian Schröter 60546d
   if (!PasswordIsDefined)
Adrian Schröter 60546d
   {
Adrian Schröter 60546d
     ClosePercents();
Adrian Schröter 60546d
-    RINOK(GetPassword_HRESULT(_so, Password));
Adrian Schröter 60546d
+    GetPassword_HRESULT(_so, Password);
Adrian Schröter 60546d
     PasswordIsDefined = true;
Adrian Schröter 60546d
   }
Adrian Schröter 60546d
   return StringToBstr(Password, password);