Encrypted rar

Thomas Jarosch thomas.jarosch at intra2net.com
Fri Nov 9 11:57:45 CET 2018


Hi Marc,

On Thursday, 8 November 2018 12:21:36 CET Grooz, Marc (regio iT) wrote:
> we found that this could be a solution?
> 
> diff -U5 /usr/sbin/amavisd-new.bak /usr/sbin/amavisd-new
> 
> --- /usr/sbin/amavisd-new.bak    2018-11-08 11:58:36.300181125 +0100
> +++ /usr/sbin/amavisd-new    2018-11-08 11:50:58.262021510 +0100
> 
> @@ -31605,10 +31605,15 @@
> 
>      } elsif (proc_status_ok($rv,$err, 3)) {  # CRC_ERROR
>        # NOTE: password protected files in the archive cause CRC_ERROR
>        do_log(4,"do_unrar: CRC_ERROR - undecipherable, %s",
>                 exit_status_str($rv,$err));
>        $part->attributes_add('U');
> +    } elsif (proc_status_ok($rv,$err, 11)) {  # ENCRYPT_ERROR
> +      do_log(4,"do_unrar: maybe PROTECTED ARCHIVE - undecipherable, %s",
> +               exit_status_str($rv,$err));
> +      $part->attributes_add('U');
>      } elsif (proc_status_ok($rv,$err, 1) && @list && $bytes > 0) {
>                                               # WARNING, probably still ok
>        do_log(4,"do_unrar: warning, %s", exit_status_str($rv,$err));
>      } elsif (!proc_status_ok($rv,$err)) {
>        die("can't get a list of archive members: " .

Intra2net sent some unrar patches upstream here:
https://gitlab.com/amavis/amavis/merge_requests/3

Specifially you need this change to detect encrypted rar archives:
https://gitlab.com/phgsng/amavis/commit/c42b345aeb44353896b41cf7fd495f61d19702c3

Or the whole branch as patch:
https://gitlab.com/amavis/amavis/merge_requests/3.diff

HTH,
Thomas





More information about the amavis-users mailing list