[Rpm-maint] [rpm-software-management/rpm] Incorrect escaping in some file attribute regexes (Issue #3212)
Michal Domonkos
notifications at github.com
Fri Jul 19 13:41:29 UTC 2024
Some of the `*.attr` files we bundle with rpm are using incorrect regex escaping of the dot character. Since the macro expansion engine itself recognizes the backslash escape character, it strips its occurrences from the macro body upon expansion. To fix that, every backslash needs to be escaped itself.
Example of a bad escape from [fileattrs/elf.attr](https://github.com/rpm-software-management/rpm/blob/master/fileattrs/elf.attr):
`%__elf_exclude_path ^/lib/modules/.*\.ko?(\.[[:alnum:]]*)$`
Example of a good escape from [fileattrs/sysusers.attr](https://github.com/rpm-software-management/rpm/blob/master/fileattrs/sysusers.attr):
`%__sysusers_path ^%{_sysusersdir}/.*\\.conf$`
There was a similar case in the redhat-rpm-config package shipped in Fedora/RHEL which is addressed by https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/309. I've also seen this issue in some other `*.attr` files shipped by other packages, specifically in `kmod.attr` so we may want to fix those in their respective repos, too.
The original issue was reported via the ticket [RHEL-28767](https://issues.redhat.com/browse/RHEL-28767).
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3212
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/3212 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240719/718b9e22/attachment-0001.html>
More information about the Rpm-maint
mailing list