[2.11.0rc1 PATCH] do_7zip: Handle completely encrypted archives

Mark Martinec Mark.Martinec+amavis at ijs.si
Mon Apr 25 14:42:05 CEST 2016


On 2016-04-14 17:59, Thomas Jarosch wrote:
> 7zip has two modes for encrypted archives:
> 
> - Visible file index, the contained file can be encrypted
> - Complete encrypted archive including the file index
> 
> Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com>
> 
> --- amavisd	2016-04-14 17:06:52.576782623 +0200
> +++ amavisd.7zip_new.pl	2016-04-14 17:35:37.013245243 +0200
> @@ -24184,6 +24184,10 @@ sub do_7zip($$$;$) {
>        elsif ($ln =~ /^Size = ([0-9]+)\z/s)   { $size = $1 }
>        elsif ($ln =~ /^Attributes = (.*)\z/s) { $attr = $1 }
>        elsif ($ln =~ /^Encrypted = \+\z/s)    { $enc = $any_encrypted = 
> 1 }
> +      elsif ($ln =~ /^ERROR: .* Can not open encrypted archive. Wrong
> password\?\z/s) {
> +        do_log(5,'do_7zip: archive is encrypted');
> +        $part->attributes_add('U','C');
> +      }
>      }
>      defined $ln || $! == 0 || $! == EAGAIN  or die "Error reading (1): 
> $!";
>      do_log(-1,"unexpected(do_7zip_1): %s",$!) if !defined($ln) && $! 
> == EAGAIN;


Thanks, applied! Will be in the release.

   Mark


More information about the amavis-users mailing list