[PATCH 1/3] amavisd: relax unrar listing regex

Philipp Gesang philipp.gesang at intra2net.com
Mon Sep 11 14:08:04 CEST 2017


unrar (version 5.5.8) does not emit a space after the leading
character for files created on Linux (host type HSYS_UNIX):

     *-rw-r--r--        11        32 290%  2016-09-12 12:47  D0A80260  some_file

Allow for a zero length match to make the regex work.

Signed-off-by: Philipp Gesang <philipp.gesang at intra2net.com>
---
 amavisd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/amavisd b/amavisd
index 7f93194..63e9ecd 100755
--- a/amavisd
+++ b/amavisd
@@ -32298,7 +32298,7 @@ sub do_unrar($$$;$) {
       } elsif ($hypcount == 1) {
         if ($unrarvers >= 5) {
           local($1,$2,$3,$4,$5);
-          if ($ln !~ /^ ([* ]) \s+ \S+ \s+ (\d+) \s+ (\d+) \s+
+          if ($ln !~ /^ ([* ]) \s* \S+ \s+ (\d+) \s+ (\d+) \s+
                       ( \d+ % | --> | <-- | <-> ) \s+
                       \S+ \s+ \S+ \s+ \S+ \s+ (.*)/xs) {
             do_log($testing_for_sfx ? 4 : -1,
-- 
2.11.1



More information about the amavis-users mailing list