During building an RPM package, I got today a strange error:
warning: Recognition of file "/var/tmp/../rsyslog/rsyslog.conf" failed: mode 100644 line 156: regex error 11 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid range expression)
The error was thrown with different files, which don't have something in common, but not with all of the files in the package. I took the file rsyslog.conf to trace the error:
$MaxMessageSize 700000
$IncludeConfig /etc/rsyslog/conf.d/*.conf
module(load="imuxsock" SysSock.Use="off")
input(type="imuxsock" Socket="/var/run/rsyslog/rsyslog.sock" unlink="on")
action(type="omfile" file="/dev/null")
The error is produced by rpmdeps command:
# /usr/lib/rpm/rpmdeps rsyslog.conf
warning: Recognition of file "rsyslog.conf" failed: mode 000000 line 156: regex error 11 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid range expression)
warning: Deprecated external dependency generator is used!
Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
Finding Requires(interp):
Finding Requires(rpmlib):
Finding Requires(verify):
Finding Requires(pre):
Finding Requires(post):
Finding Requires(preun):
Finding Requires(postun):
Finding Requires(pretrans):
Finding Requires(posttrans):
Finding Requires: /usr/opt/rpm/lib/rpm/find-requires
Finding Conflicts:
Finding Obsoletes:
Finding Recommends:
Finding Suggests:
Finding Supplements:
Finding Enhances:
Tracing further I found that the problem line lays in /usr/opt/rpm/share/misc/magic:
5001:0 regex =^[!-?A-~]{1,255}(\t[^\t]+){11}
Because I didn't the error earlier, I checked the elder versions of rpm.rte. The last version which didn't produce the error was 4.13.0.8:
# lslpp -Lqc rpm.rte
rpm.rte:rpm.rte:4.13.0.8: : :C: :RPM Package Manager: : : : : : :0:0:/:
# rpm --version
RPM version 4.13.0.1
# /usr/lib/rpm/rpmdeps rsyslog.conf
Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
Finding Requires(interp):
Finding Requires(rpmlib):
Finding Requires(verify):
Finding Requires(pre):
Finding Requires(post):
Finding Requires(preun):
Finding Requires(postun):
Finding Requires(pretrans):
Finding Requires(posttrans):
Finding Requires: /usr/opt/rpm/lib/rpm/find-requires
The newer versions have the updated magic file and the error:
# lslpp -Lqc rpm.rte
rpm.rte:rpm.rte:4.13.0.9: : :C: :RPM Package Manager: : : : : : :0:0:/:
# rpm --version
RPM version 4.13.0.1
# /usr/lib/rpm/rpmdeps rsyslog.conf
warning: Recognition of file "rsyslog.conf" failed: mode 000000 line 156: regex error 11 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid range expression)
Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
Finding Requires(interp):
Finding Requires(rpmlib):
Finding Requires(verify):
Finding Requires(pre):
Finding Requires(post):
Finding Requires(preun):
Finding Requires(postun):
Finding Requires(pretrans):
Finding Requires(posttrans):
Finding Requires: /usr/opt/rpm/lib/rpm/find-requires
The problem occurs if I use UTF-8 encoding, which is standard on my build system. If I swith to C, everything work OK even with newer version:
$ LANG=C /usr/lib/rpm/rpmdeps rsyslog.conf
Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
Finding Requires(interp):
Finding Requires(rpmlib):
Finding Requires(verify):
Finding Requires(pre):
Finding Requires(post):
Finding Requires(preun):
Finding Requires(postun):
Finding Requires(pretrans):
Finding Requires(posttrans):
Finding Requires: /usr/opt/rpm/lib/rpm/find-requires
$ LANG=en_US.UTF-8 /usr/lib/rpm/rpmdeps rsyslog.conf
warning: Recognition of file "rsyslog.conf" failed: mode 000000 line 156: regex error 11 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid range expression)
Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
Finding Requires(interp):
Finding Requires(rpmlib):
Finding Requires(verify):
Finding Requires(pre):
Finding Requires(post):
Finding Requires(preun):
Finding Requires(postun):
Finding Requires(pretrans):
Finding Requires(posttrans):
Finding Requires: /usr/opt/rpm/lib/rpm/find-requires
------------------------------
Andrey Klyachkin
https://www.power-devops.com------------------------------