Minor bug with regex and zmsyslogsetup

Zimbra Collaboration 8.8 Beta
Locked
User avatar
DualBoot
Elite member
Elite member
Posts: 1326
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Minor bug with regex and zmsyslogsetup

Post 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
User avatar
msquadrat
Advanced member
Advanced member
Posts: 183
Joined: Mon Oct 14, 2013 10:09 am

Re: Minor bug with regex and zmsyslogsetup

Post 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.
User avatar
DualBoot
Elite member
Elite member
Posts: 1326
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: Minor bug with regex and zmsyslogsetup

Post by DualBoot »

Thank you for the reference.
Locked