7z archives with encrypted content

Mark Martinec Mark.Martinec+amavis at ijs.si
Mon Feb 15 20:45:00 CET 2016


On 2014-12-02 13:36, Markus Benning wrote:
> Hello,
> 
> amavis currently fails to handle 7z files with encrypted content.
> 
> To reproduce create a 7z file with encrypted content:
> 
> $ 7z a -ppass enc.7z /etc/hosts
> 
> This will result in amavisd logging the following error:
> 
> Dec  2 10:14:41 xxxxxxx amavis[16806]: (16806-01) (!!)collect_results 
> from
> [21779] (/usr/bin/7za): exit 2
> \n7-Zip (A) [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov
> 2010-11-18\np7zip Version 9.20 (locale=en_U
> S.UTF-8,Utf16=on,HugeFiles=on,1 CPU)\n\nProcessing archive:
> /var/spool/amavisd/tmp/amavis-20141202T1014
> 40-16806-dAeC3ffA/parts/p002\n\nExtracting  xxxxxxxxx\n\nEnter
> password (will not be echoed) :Extr
> acting  issue     Data Error in encrypted file. Wrong password?\n\nSub
> items Errors: 1\n\n
> 
> Attached is a first attempt to make do_7zip() only extract unencrypted
> content.
> 
> I still see 2 weak points in the patch:
> 
>  * make sure quoting is right for 7z
>  * the file list may be to big for @ARGV

Got it, thanks. With some modification it will be in 2.11.0.

>  * make sure quoting is right for 7z

No need to bother about quoting, the 7z is not invoked through a shell,
so no quoting is needed - actually it must not be used.

>  * the file list may be to big for @ARGV

If there are no encrypted files the list is not needed, can be empty.

   Mark


More information about the amavis-users mailing list