Page 1 of 1

Minor bug with regex and zmsyslogsetup

Posted: Tue Jul 18, 2017 9:25 pm
by DualBoot
Hello Team,

I got this little bug which is not blocking the installation :

Code: Select all

Tue Jul 18 23:12:34 2017 *** Running as root user: /opt/zimbra/libexec/zmsyslogsetup
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(^destination mail { <-- HERE  file\("/var/log/mail"\); };)/ at /opt/zimbra/libexec/zmsyslogsetup line 190.
I saw it in the install history log.

Regards

Re: Minor bug with regex and zmsyslogsetup

Posted: Wed Jul 19, 2017 9:55 am
by msquadrat
The issue is here:

https://github.com/Zimbra/zm-core-utils ... setup#L190

Code: Select all

while (<>) {
      s/(^destination mailinfo.*)/#$1/;
      s/(^log.*f_mailinfo)/#$1/;
      s/(^destination mailwarn.*)/#$1/;
      s/(^log.*f_mailwarn)/#$1/;
      s/(^destination mailerr.*)/#$1/;
      s/(^log.*f_mailerr)/#$1/;
      s|(^destination mail { file\("/var/log/mail"\); };)|#$1|;
      s/(^log.*filter\(f_mail\); destination\(mail\); };)/#$1/;
      print;
}
Those curly braces should be escaped.

Looks like this part of the code is 7 years old, so probably not caused by the 8.8 changes but by a newer and more strict Perl version. Should be fixed anyway.

Re: Minor bug with regex and zmsyslogsetup

Posted: Wed Jul 19, 2017 10:18 am
by DualBoot
Thank you for the reference.