No prompt for 7z archive password.
Status: Abandoned
Brought to you by:
gt67
Hi,
Xarchiver 0.5.4 doesn't prompt for the password of an encrypted 7z archive. It shows an error instead:
7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,4 CPUs)Enter password (will not be echoed) :
Error: /run/user/1000/gvfs/smb-share:server=nas.local,share=*: Can not open encrypted archive. Wrong password?Errors: 1
Regards,
Ettore
Xarchiver 0.5.4 doesn't understand 7z passwords at all. When file list es encrypted, gui throws 'An error occured', otherwise Xarchiver sometimes hangs, and if not, Password field in 'Extract files' is disabled.
Hello,
can you provide a nice patch?
Thanks
Giuseppe
--
Anti aging stem cell based cosmeceuticals, business for anyone
https://www.facebook.com/antiagingeurope/
On 12 October 2016 at 16:56, beelzebubbie beelzebubbie@users.sf.net wrote:
Related
Bugs: #90
Nice patch? :-) I've read your 2005 year thread about decoding 7z headers and checking if archive is encrypted. There was no shame to leave an idea to reimplement 7z decoder, but of course one can steal relevant code from SDK (http://7-zip.org/sdk.html). Though it'll be a bit of work too (I quickly look into cpp code and found there is no way to quickly create a simple C code from it) :-)
Maybe we can implement another solution? E.g. we can create simply shell script to detect encryption. If you are ok to add shell script invocation into xa_detect_encrypted_archive(), I can write and maintain it.
Yep sure, why not? Nice idea! Please do it. Thanks :)
Giuseppe
Anti aging stem cell based cosmeceuticals, business for anyone
https://www.facebook.com/antiagingeurope/
On 12 October 2016 at 19:59, beelzebubbie beelzebubbie@users.sf.net wrote:
Related
Bugs: #90
A couple of thoughts about implementing detecting script:
Detection can be done via something like '7z l -p filename.7z', but everything we really need is a «header», a part of output before file listing (actually, 'Method =' line). So we should terminate 7z process immediately after reading this line (in case the archive contain a lot of files, full listing is a waste of time and resources)
One problem is there is no easy way to turn off output buffering so we can:
a) «ignore» buffering, so we can terminate 7z process with long listing only after receiving 4K of output
b) use something like this: http://expect.sourceforge.net/example/unbuffer.man.html but we should add a dependency for it.
c) write script in python and use built-in pty libs (new dependency again; but almost all modern linux distros have python installed, so there will not be a really new dependency)
UPD: seems we can use stdbuf (part of coreutils) instead of unbuffer
Which way is better, how'd you think?
Last edit: beelzebubbie 2016-10-13
I would prefer not to add further dependancies, I developed Xarchiver
mainly for this reason. So option a would be ok. What of libarchive then?
If it supports 7z encryption I could change idea... ;)
Giuseppe
--
Anti aging stem cell based cosmeceuticals, business for anyone
https://www.facebook.com/antiagingeurope/
On 13 October 2016 at 05:09, beelzebubbie beelzebubbie@users.sf.net wrote:
Related
Bugs: #90
Well, let's check what hides beneath libarchive's «Formats Supported … 7-Zip (read only, starting in libarchive 3.0)». Does it include encryption – is a main question :-)
Ok, I would say then go with option a) then!
--
Anti aging stem cell based cosmeceuticals, business for anyone
https://www.facebook.com/antiagingeurope/
On 13 October 2016 at 11:27, beelzebubbie beelzebubbie@users.sf.net wrote:
Related
Bugs: #90
Giuseppe, can I ask you to not quote all the stuff in every message? It makes thread hardly readable :-)
about a) option – do you think the coreutils dependency is a bad idea? Do we plan to install xarchiver to routers and embedded systems? :-) I hardly believe that someone uses gtk but not uses coreutils
before going further, I plan to investigate libarchive API and more, I think it worth to look into file-roller code to check how it detects 7z encryption.
Apologies, Ettore, I didn't realize that! Good idea to look at file roller
code! I agree!
Giuseppe
seems noone want to get into Pavlov's code :-D
fileroller's code (fr-command-7z.c) relays on parsing listing output too:
As for me, such an approach (rigid, fragile and built-in parsing of third-party process output) should never exist at all. At least we should use regular expressions.
I'll check libarchive later, and if it fails, I'll start to write a script
Good news, everyone! :-) Giuseppe, your guess about libarchive was brilliant!
At least, we easily can detect 7z encryption, but not only for 7z. More, I guess we can use libarchive' archive type/needed_properties detection too.
For instance, we can read headers until we find encrypted one:
( https://github.com/libarchive/libarchive/wiki/Examples )
archive_entry.h defines encryption-related entry functions:
obviously, now we have enough API to detect anything we need about any archive.
sorry, right now I can't write proper C code because last time I wrote something in C was long, long time ago...
That's a good news indeed! I think the whole code must be rewritten now as
it would be no sense to add libarchive as a dependancy only to check
encrypted archives. I also would take the opportunity to use GTK+3 rather
than the obsolete 2.
Any good developer can help?
--
Anti aging stem cell based cosmeceuticals, business for anyone
https://www.facebook.com/antiagingeurope/
On 13 October 2016 at 17:12, beelzebubbie beelzebubbie@users.sf.net wrote:
Related
Bugs: #90
It's not so hard to use functions from well-written code (seems libarchive is good enough) but it's far more hard to understand current code and properly refactor it....
Just an idea – maybe we can migrate to python? There is a good adapter to libarchive – https://github.com/dsoprea/PyEasyArchive so I can implement non-gui code parts. Hope we can even avoid running command-line archive utilities and process archives in a more straight and clear way
No, thanks.
Well, let's implement shell script detection then. Ok?
Yeeeeees!
Giuseppe
Please check a patch#27